On 5 March 2014 10:04, Igor Korot <ikoro...@gmail.com> wrote:
> Hi, ALL,
> Let's say I have a table with following data:
>
> field1    field2    field3   field4
> 1            2          3         4
> 5           6           7         8
>
> How do I write a query which will produce the output as:
>
> 1 2
> 5 6
> 3 4
> 7 8
>
> Is it possible to write a single query which will produce the output like
> this?
> And not just in SQLite....

Possibly:
select v1, v2 from ( select 1 as ordr, f1 as v1, f2 as v2 from t union
all select 2, f3, f4 from t ) order by ordr, v1;

>
> Thank you.

Regards,
Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to