Subject Re: [firebird-support] Trouble with select
Author Thomas Steinmaurer
> Im trying a bit difficult select:
>
> select id, value
> from MyTable
> where id in (1, 1, 1, 2, 3, 3, 4)
>
> I want that fore every value inside IN a row is output, so for example this would result something like:
> 1 | 40
> 1 | 40
> 1 | 40
> 2 | 21
> 3 | 23
> 3 | 23
> 4 | 87
>
> But now I don't take duplicates, result is
> 1 | 40
> 2 | 21
> 3 | 23
> 4 | 87
>
> Can someone help me to create that tricky select?

My SQL area of my brain doesn't work very well today, so I guess the
only way to do that is via a stored procedure, but this won't be very
flexible.


--
With regards,
Thomas Steinmaurer (^TS^)
Firebird Technology Evangelist

http://www.upscene.com/
http://www.firebirdsql.org/en/firebird-foundation/