List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:December 27 1999 11:39pm
Subject:Re: multiple limits in a query
View as plain text  
In the last episode (Dec 27), Joel Bremson said:
> I don't think this is possible, but I said I'd look into this so...
> 
> Is it possible to run a query with multiple limits. Something like:
> 
> SELECT * FROM players WHERE
>     TEAM = 'sox' LIMIT 5 AND
>     TEAM = 'reds' LIMIT 4 AND
>     TEAM = 'dodgers' LIMIT 3

Huh?  ( TEAM='sox' AND TEAM='reds' ) is never going to match any
records.

If you want do do what I think you want to do ( 5 sox + 4 reds + 3
dodgers = 12 total records), you'll need 3 separate queries.  If/when
UNION is implemented, you will be able to do it with one compound
query.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Y2K StuffMichael L Smith9 Dec
  • Re: Y2K StuffSteve Ruby9 Dec
  • Re: Y2K StuffJay J9 Dec
  • Re: Y2K StuffRuben I Safir9 Dec
  • Re: Y2K StuffPaul D. Smith9 Dec
  • multiple limits in a queryJoel Bremson28 Dec
    • Re: multiple limits in a queryDan Nelson28 Dec