Subject | Re: Trouble with select |
---|---|
Author | raistware |
Post date | 2012-02-09T08:09:40Z |
Finally I created a store procedure that I call it with a string parameter "1,1,1,2,3,3,4" and creates what I need. I think is only way to get what I need.
Thank you all for your time.
Thank you all for your time.
--- In firebird-support@yahoogroups.com, "raistware" <raul.ferriz@...> wrote:
>
> Hi
>
> 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?
>
> Many thanks in advance
>