Subject | RE: [firebird-support] Trouble with select |
---|---|
Author | Leyne, Sean |
Post date | 2012-02-08T20:29:26Z |
Woody,
He wants 1 row for each IN () list item, including duplicates -- which runs against conventional logic.
The only solution I can see is a UNION ALL, but that would be a very ugly SQL.
Sean
> > Im trying a bit difficult select:You have misunderstood the Ops question. That would give him the exact same result he is seeing now.
> >
> > select id, value
> > from MyTable
> > where id in (1, 1, 1, 2, 3, 3, 4)
> >
>
> Try:
>
> select DISTINCT id, value
> from MyTable
> where id in (1, 1, 1, 2, 3, 3, 4)
He wants 1 row for each IN () list item, including duplicates -- which runs against conventional logic.
The only solution I can see is a UNION ALL, but that would be a very ugly SQL.
Sean