Subject Re: SQL statement with multiply function
Author Ali Gökçen
Here is rocket tech:

select t1.id,t1.name from table1 t1
join table1 t2
on t2.id<(select first 1 skip t1.qty id from table1 order by id)

good luck to u on the sql space..

Ali

--- In firebird-support@yahoogroups.com, "majstoru" <majstoru@...>
wrote:
>
> Hi,
>
> I have a data in table (example)
> Table1
> id name qty
> 1 Article 1 3
> 2 Article 2 2
> 3 Article 3 1
>
> is there any solution if Firebird that I can write SQL statement
which
> will return this table in format
> Table2
> id name
> 1 Article 1
> 1 Article 1
> 1 Article 1
> 2 Article 2
> 2 Article 2
> 3 Article 3
>
> whih mean that I get result table where avery record is multiplied
> with qty, or how many rows are in resultset, that is represent a
qty
> column in table1.
>
> Thanks for help!
>