Re: Re: php-db Finding records with NULL values
| From: | DL Neil | Date: | Wed, 27 Feb 2002 17:03:17 +0000 |
| Subject: | Re: Re: php-db Finding records with NULL values | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17325@lists.php.net to get a copy of this message | ||
Robin
> That may work for a single field in a record that is NULL, but I'm trying to
> join two tables, and report the lines that do not have an entry in the
> second thus:
>
> Question Table
>
> Q_id Question
> 1 Question 1
> 2 Question 2
> 3 Question 3
> 4 Question 4
>
> Response Table
>
> R_id Member_id Q_id Response
> 1 1 1 Yes
> 2 1 3 No
>
>
> So, member 1 has answered questions 1 and 3 - I want to find how to get the
> q_ids of the remaining questions...
>
> Q_id
> 2
> 4
Check out OUTER JOINs (RTFM: 6.4.1.1 JOIN Syntax)
=dn