Subject | Re: [firebird-support] Re: Problem with joined subqueries |
---|---|
Author | Sofija Blazevski |
Post date | 2009-11-16T10:16:45Z |
klitscheronald wrote:
from 1.5 to 2.1.3
this might be a workaround for 2.1.3
SELECT t1.id FROM table1 t1
WHERE (t1.id IN (SELECT A.ID
FROM table1 A
JOIN table1 B ON B.ID = A.ID
WHERE B.ID IN('1', '2', '3')
)
)
AND (NOT EXISTS (SELECT A1.ID
FROM table1 A1
JOIN table1 B1 ON B1.ID = A1.ID
WHERE B1.ID IN('2', '3')
AND B1.ID=T1.ID
)
)
>This seems like a big issue, I tried it myself as we just decided to go
> > Try it this way instead and report back:
> >
> > SELECT t1.id FROM table1 t1
> > WHERE
> > t1.id IN (SELECT A.ID FROM table1 A
> > JOIN table1 B ON B.ID = A.ID
> > WHERE B.ID IN('1', '2', '3'))
> > AND
> > NOT t1.id IN (SELECT A1.ID FROM table1 A1
> > JOIN table1 B1 ON B1.ID = A1.ID
> > WHERE B1.ID IN('2', '3'))
> >
> > ./helen
>
> Hi Helen,
>
> No, not working.
>
> Ronald
>
from 1.5 to 2.1.3
this might be a workaround for 2.1.3
SELECT t1.id FROM table1 t1
WHERE (t1.id IN (SELECT A.ID
FROM table1 A
JOIN table1 B ON B.ID = A.ID
WHERE B.ID IN('1', '2', '3')
)
)
AND (NOT EXISTS (SELECT A1.ID
FROM table1 A1
JOIN table1 B1 ON B1.ID = A1.ID
WHERE B1.ID IN('2', '3')
AND B1.ID=T1.ID
)
)
>
>
>