Igor,
select * from (select * from fruits where type = 'apple' order by price limit 2)
union all
select * from (select * from fruits where type = 'orange' order by price limit
2)
SQlite allows only one LIMIT clause per query, that is applied to the
final resultset
---
Yuriy Martsynovskyy
<[EMAIL PROTECTED]> wrote:
I need to select top 2 (or N) most expensive fruits of each type from
this table:
+++---+
type | variety| price |
+++---+
apple | gala | 2.79 |
apple | fuji | 0.24 |
apple | li
2 matches
Mail list logo