Joining multiple tables results not complete

2003-02-19 Thread Dean Householder
I am perplexed trying to retrieve all the rows I need in the query I'm doing. I have a table with keeping track of people using ID numbers as the primary key and another table with coupon numbers and a reference to the first table. But not all the second table is going to have correlating

Re: Joining multiple tables results not complete

2003-02-19 Thread Brent Baisley
Well then you are looking to do a left join. SELECT table1.id, table2.coupon FROM table1 LEFT JOIN table2 ON table1.id=table2.person_id; In your example, the WHERE is not only a join condition, but also a filter. It gives you exactly what you asked for, only those records whose id's match. A

Re: Joining multiple tables results not complete

2003-02-19 Thread KH Chiu
You should use LEFT JOIN. Regards, I am perplexed trying to retrieve all the rows I need in the query I'm doing. I have a table with keeping track of people using ID numbers as the primary key and another table with coupon numbers and a reference to the first table. But not all the