A group_id cannot be both 1 AND 3, but it can be 1 OR 3.
Try OR
Jouni Hartikainen wrote:
>
> Hi.
>
>> > how about:
>> >
>> > select record.*
>> > from link
>> > where group_id='x'
>> > left join record on record.archive_id=link.archive_id
>> > ?
>
>
> The problem with this query is that with simple left join, I can
> search only by a single group.
> If I set x to 3 here, I get all records that belong to group 3. But
> what about if I want to have all records that belong to groups 1 AND
> 3? If I add condition "WHERE group_id='1' AND group_id='3'", I get no
> results at all, since left join doesn't produce such rows that have
> multiple group_id columns.
>
>
> Sincerely,
>
> Jouni Hartikainen
> kalle_kukkanen@stripped
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>