- Oct 17, 2008
- 33
- 0
- 0
I want to make a stored procedure from calling the customer_id number off a table. I want to make this select to make a mailing address for the customer including business name, address, city, state and zip code, but I can not figure out how to produce the info in 3 lines like a normal mailing address
here's a made up sample of the format of the table table, any help would be great
+-------------+-----------------------+-------------------+-----------------+-------+-------+---------------------+-------------------+--------+-------+------+--------+-------+------+----------+------------+--------+-----------+---------+
| customer_id | customer_name | address | city | state | zip | email | url | acodep | xchgp | nump | acodef | xchgf | numf | poc_tit | poc_fname | poc_mi | poc_lname | poc_suf |
+-------------+-----------------------+-------------------+-----------------+-------+-------+---------------------+-------------------+--------+-------+------+--------+-------+------+----------+------------+--------+-----------+---------+
| 1 | Lowes | 3445 Elm Street | Bryan | TX | 77802 | sales@lowes.com | www.lowes.com | 979 | 856 | 5433 | 979 | 556 | 5432 | manager | James | T | Kirk | NULL |
| 2 | Home Depot | 234 2nd Street | College Station | TX | 77801 | sales@homedepot.com | www.homedepot.com | 979 | 565 | 3323 | 979 | 565 | 3322 | salesman | Jonathan | NULL | Archer | NULL |
| 3 | D-Square | 4554 High Avenue | College Station | TX | 77801 | sales@d-square.com | www.d-square.com | 979 | 268 | 5789 | 979 | 268 | 5788 | manager | Montgomery | NULL | Scott | NULL |
| 4 | Construction Supplies | 12 Mosswood Drive | Conroe | TX | 76572 | sales@consupp.com | www.consupp.com | 979 | 453 | 3345 | 979 | 453 | 3346 | manager | Katherine | NULL | Janeway | NULL |
+-------------+-----------------------+-------------------+-----------------+-------+-------+---------------------+-------------------+--------+-------+------+--------+-------+------+----------+------------+--------+-----------+---------+
here's a made up sample of the format of the table table, any help would be great
+-------------+-----------------------+-------------------+-----------------+-------+-------+---------------------+-------------------+--------+-------+------+--------+-------+------+----------+------------+--------+-----------+---------+
| customer_id | customer_name | address | city | state | zip | email | url | acodep | xchgp | nump | acodef | xchgf | numf | poc_tit | poc_fname | poc_mi | poc_lname | poc_suf |
+-------------+-----------------------+-------------------+-----------------+-------+-------+---------------------+-------------------+--------+-------+------+--------+-------+------+----------+------------+--------+-----------+---------+
| 1 | Lowes | 3445 Elm Street | Bryan | TX | 77802 | sales@lowes.com | www.lowes.com | 979 | 856 | 5433 | 979 | 556 | 5432 | manager | James | T | Kirk | NULL |
| 2 | Home Depot | 234 2nd Street | College Station | TX | 77801 | sales@homedepot.com | www.homedepot.com | 979 | 565 | 3323 | 979 | 565 | 3322 | salesman | Jonathan | NULL | Archer | NULL |
| 3 | D-Square | 4554 High Avenue | College Station | TX | 77801 | sales@d-square.com | www.d-square.com | 979 | 268 | 5789 | 979 | 268 | 5788 | manager | Montgomery | NULL | Scott | NULL |
| 4 | Construction Supplies | 12 Mosswood Drive | Conroe | TX | 76572 | sales@consupp.com | www.consupp.com | 979 | 453 | 3345 | 979 | 453 | 3346 | manager | Katherine | NULL | Janeway | NULL |
+-------------+-----------------------+-------------------+-----------------+-------+-------+---------------------+-------------------+--------+-------+------+--------+-------+------+----------+------------+--------+-----------+---------+