Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple columns into one?

Status
Not open for further replies.

jjw78

Programmer
Oct 6, 2006
1
US
I often need to compare the results from two queries and concantinate and resort them to formulate a single list. I usually do this with two seperate queries and then I work on the resulting record sets in the programming language, but is it possible to return a single result to avoid that, but at the same time weeding out duplicates?

For instance, two queries return the following. Picture these as the results of of a much larger query, perhaps returning all the logged entries for a certain city on a certain date, etc.. One returns the north east and the other specific cities..

"Foo" Halifax, Boston, Yarmouth
"Bar" Boston, Chicago, Oakland

and I want:

"Result" Halifax, Boston, Yarmouth, Chicago, Oakland

The problem is that these are usually the products of more complex queries, and there may be no common key, so I'm not sure how to do a join based solely on the results of a select statment.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top