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

Query Multiple tables

Status
Not open for further replies.

RadioX

IS-IT--Management
May 15, 2001
145
US
I am setting up a newsletter engine. I have three tables and they are as follows

Table1
Memberid
Member_email
etc

Table2
Listid
Listname

Table3
Varid
Listid
Memberid

Each member should be able to subscribe to multiple lists. This is where table 3 comes into play. The meber id is stored with the listid. So I cold have member id 305 with listid 1 and memberid 305 with listid2.

Now what I want to to is run a query that selects all members that are a member of listid 1 per say or any list that I select from my html form and show there email address, wheather they are active or not all from table1

I know this is possible I am just running into a brain fart on how to do it. Any help would be greatly appreciated.

Thanks
Ron
 
SELECT TB1.Member_email , TB1.Whatever
FROM Table1 TB1
JOIN Table3 TB3
ON TB1.Memberid = TB3.Memberid
WHERE TB3.Listid = <Constant | Parameter>






Walid Magd
Engwam@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top