homepage Welcome to WebmasterWorld Guest from 54.145.243.51
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
A question about selecting data from joined tables.
nelsonm

5+ Year Member



 
Msg#: 4239965 posted 4:29 am on Dec 8, 2010 (gmt 0)

Hi all,

You join two tables, such as a United States and a Canadian postal code table, where each has a PostalCode field.

I know that you can "SELECT us.PostalCode, ca.PostalCode from us JOIN ca ON whatever".

The question is...

Can i "SELECT PostalCode from us JOIN ca ON whatever"? In other words, can i have the query dump all the postal codes from both tables into the single results field array?

 

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4239965 posted 2:55 pm on Dec 8, 2010 (gmt 0)

Sounds like a job for UNION. I don't know which database you are using, but here is the MySQL man page for UNION Syntax, should get you started in the right direction.
[dev.mysql.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved