I want to know if this is possible in SQL. I have 2 tables, an address table and a table where an address may have a number of emailhost associated with it.
I have 2 tables Address and Emails
Address Table
addrid name city
--------------------
1 Joe Seattle
2 Jane Boston
3 John Seattle
Emails Table
emailid addrid emailhost
----------------------
1 1 hotmail.com
2 2 hotmail.com
3 2 yahoo.com
4 1 yahoo.com
5 3 yahoo.com
I want an SQL that will be able to locate the addrid of the person who matches city of Seattle, and email host of yahoo.com and hotmail.com. I would expect the answer to be addrid 1.
What is a good way using SQL to select out emailid's from the email table given a set of emailhosts. I want to be able to answer the question which emailid has emailhosts on yahoo.com only?
thanks
I have 2 tables Address and Emails
Address Table
addrid name city
--------------------
1 Joe Seattle
2 Jane Boston
3 John Seattle
Emails Table
emailid addrid emailhost
----------------------
1 1 hotmail.com
2 2 hotmail.com
3 2 yahoo.com
4 1 yahoo.com
5 3 yahoo.com
I want an SQL that will be able to locate the addrid of the person who matches city of Seattle, and email host of yahoo.com and hotmail.com. I would expect the answer to be addrid 1.
What is a good way using SQL to select out emailid's from the email table given a set of emailhosts. I want to be able to answer the question which emailid has emailhosts on yahoo.com only?
thanks