Re: [sqlite] How to write a query

2014-03-05 Thread RSmith
On 2014/03/05 12:24, Igor Korot wrote: With UNION I will have 2 DB hits, correct? Meaning I execute the part on the left side of the UNION and then execute the right side of the UNION and then add the results together. Do I understand correctly? Thank you. Yes. Obviously you need to have the

Re: [sqlite] How to write a query

2014-03-05 Thread RSmith
On 2014/03/05 12:04, Igor Korot wrote: Hi, ALL, Let's say I have a table with following data: field1field2field3 field4 12 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

Re: [sqlite] How to write a query

2014-03-05 Thread Simon Davies
On 5 March 2014 10:24, Igor Korot wrote: > Hi, Simon, > . . . >> >> 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; >> > > With UNION I will have 2 DB hits, correct? > Meaning I execute the

Re: [sqlite] How to write a query

2014-03-05 Thread Igor Korot
Hi, Simon, On Wed, Mar 5, 2014 at 2:21 AM, Simon Davies wrote: > On 5 March 2014 10:04, Igor Korot wrote: > > Hi, ALL, > > Let's say I have a table with following data: > > > > field1field2field3 field4 > > 12 3

Re: [sqlite] How to write a query

2014-03-05 Thread Simon Davies
On 5 March 2014 10:04, Igor Korot wrote: > Hi, ALL, > Let's say I have a table with following data: > > field1field2field3 field4 > 12 3 4 > 5 6 7 8 > > How do I write a query which will produce the output as:

[sqlite] How to write a query

2014-03-05 Thread Igor Korot
Hi, ALL, Let's say I have a table with following data: field1field2field3 field4 12 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