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 matches to
the first table.  So, in other words not all people have a coupon number
entered into the database.

I run the query:

SELECT table1.id, table2.coupon FROM table1, table2 WHERE
table1.id=table2.person_id;

I expect back a report of the 213 rows in table1 and their matching coupon #
if they have one.  Instead, I get 174 rows and THEIR matching coupons but no
results from the others.  I want to write a query that will return the id's
from table1 and the table2 coupon regardless of whether the table2.person_id
matches table1.id.

How do I do this?

Thanks,
Dean


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to