I am trying to union two queries with each query having a sub-select
defining the table, but I consistenly get no results if I try to limit
the sub-query.  Here is my query, assuming the table a and table contain
one column filled with integers.

Select * from (select * from a limit 3) as a;   <-- this returns 3
results
Select * from (select * from b limit 3) as b;   <-- this returns 3
results

Select * from (select * from a limit 3) as a union select * from (select
* from b limit 3) as b; <-- this returns 0 results

If I get rid of the limits, everything is returned from both tables as
it should be:
Select * from (select * from a) as a union select * from (select * from
b) as b;

Unfortunately, I need to limit the results in individual queries which
are being unioned together.  Since SQLite does not support limiting
individual queries in a union, I was hoping to use sub-selects for the
tables and limit these.  Does anyone have any suggestions as to what I
can do for this?

Thanks,

Bob Dankert

-----Original Message-----
From: George Ionescu [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 16, 2004 1:00 AM
To: SQLite Forum
Subject: Re: [sqlite] db admin tool

Hello sten,

you could try SQLiteDb Query Analyzer from
http://www.terrainformatica.com/sqlitedb
(it's included in the SQLiteDb install package).

It's not much right now but it's going to be improved alot in the next
weeks.

Best regards,
George Ionescu

Reply via email to