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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join two feilds from two tables as One 1

Status
Not open for further replies.

alexanderthegreat

IS-IT--Management
Sep 9, 2005
70
US
I have 2 tables contact and quote, each ask someone if they want to recieve more info. I want to create a query that can query both contact and quote table for those you said 'Yes' to recieve more, and join the emails together in one new feild (distinct values if possible)sort ascending

SELECT contact.email, quote.email
FROM contact, quote
WHERE (((contact.getmore)="Yes") AND ((quote.getmore)="Yes"));
 
Isn't this more a queries question (forum701)?

[tt]select email
from contact
where contact.getmore = "yes"
union
select email
from quote
where quote.getmore = "yes"
order by 1[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top