Thanks, I tried that and it gives no error, but only gives the first
lot, not the bit after the union all.

RBS


On Wed, Nov 24, 2010 at 10:27 AM, Swithun Crowe
<swit...@swithun.servebeer.com> wrote:
> Hello
>
> BS> select
> BS> patient_id
> BS> from
> BS> table1
> BS> where
> BS> age = 50
> BS> limit 6
> BS> union all
> BS> select
> BS> patient_id
> BS> from
> BS> table1
> BS> where
> BS> age = 60
> BS> limit 4
>
> You might want to wrap the two selects with limits inside subqueries:
>
> select patientID
> from (
>  select patientID
>  from table1
>  where age = 50
>  limit 6
> )
> union all
> select patientID
> from (
>  select patientID
>  from table1
>  where age = 60
>  limit 4
> );
>
> Swithun.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to