| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Jouni Hartikainen | Date: | October 12 2003 8:25am |
| Subject: | RE: How to search by groups efficiently with MySql 4.0.15? | ||
| View as plain text | |||
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
| Thread | ||
|---|---|---|
| • How to search by groups efficiently with MySql 4.0.15? | Jouni Hartikainen | 11 Oct |
| • RE: How to search by groups efficiently with MySql 4.0.15? | Pakó Géza | 11 Oct |
| • RE: How to search by groups efficiently with MySql 4.0.15? | Jouni Hartikainen | 12 Oct |
| • Re: How to search by groups efficiently with MySql 4.0.15? | gerald_clark | 13 Oct |
| • Re: How to search by groups efficiently with MySql 4.0.15? | Jouni Hartikainen | 15 Oct |
| • Re: How to search by groups efficiently with MySql 4.0.15? | Roger Baklund | 15 Oct |
| • Re: How to search by groups efficiently with MySql 4.0.15? | Jouni Hartikainen | 16 Oct |
