|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL Syntax Help
I have two tables named shopper and recipients. In side shopper and recipient i have a fileds vfirstnamd, vlastname, vaddress, and ccity.
Question: WHat SQL Command shall I issue to get the above information in the following format: Column 1 Column 2 Coulumn 3 Coulumn 4 First name Last Name Address City I think I need to join two table as one but i don't know how to do this. please help me. Thanks a lot. |
|
#2
|
|||
|
|||
|
Why do you want to join these tables? In other words, how is the data related?
If you just want a list of ALL records from both tables as if they were one (in other words, all of one, piled on top of all of the other), you can just do a simple UNION join: SELECT * FROM shopper UNION SELECT * FROM recipient; This will work if each table has columns of the same name and type, otherwise you will need to include column naming, and possibly casting options in your query.
__________________
The real n-tier system: FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL Amazon wishlist -- rycamor (at) gmail.com |
![]() |
| Viewing: Dev Shed Forums > Databases > PostgreSQL Help > SQL Syntax Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|