workaround for outer join using filtering subquery
- From: "Steve Claflin" <steve@xxxxxxxxxxxxxxxx>
- Date: Sat, 24 Sep 2005 16:05:59 GMT
I'm using mysql 4.0.x, which does not allow the following query (which works
fine in 4.1). Is there any way I can issue a single query to achieve the
same results? (I want a list of all records from table al, nulled where
there is no match in table alm, which has been filtered. Without a
subquery, the filtering occurs after the outer join, and for one specific
row from alm, I only see the nonmatching records from al where NO other alm
record matches.)
SELECT al.id, alm.idmember, al.listname
FROM addresslists AS al
LEFT OUTER JOIN
(SELECT idlist, idmember FROM addresslistmembers WHERE idmember = 4)
AS alm
ON al.id = alm.idlist
.
- Follow-Ups:
- Re: workaround for outer join using filtering subquery
- From: Dieter Noeth
- Re: workaround for outer join using filtering subquery
- From: Stefan Rybacki
- Re: workaround for outer join using filtering subquery
- Prev by Date: Re: Looking for DBA with RAC
- Next by Date: Re: workaround for outer join using filtering subquery
- Previous by thread: MySQL admin tool
- Next by thread: Re: workaround for outer join using filtering subquery
- Index(es):
Relevant Pages
|
|