This should do it:
select * from Options o1
where rowid in (
select o2.rowid from Options o2
where o1.StockSymbol = o2.StockSymbol and o1.ExpiryDate=o2.ExpiryDate
and o2.StrikePrice < o2.StockPrice
limit 4);
Thanks Igor, this doesn't work (no results are displayed) which may well
be that I haven't implemented your solution correctly but it has
certainly given me some idea about where to look and how to use LIMIT 4
in a way that generates more than just a total of 4 rows.
I wouldn't be surprised if it turns out to be faster to just retrieve
all records and skip over all but the first four in each group in your
program.
I will explore this suggestion as well as your first suggestion seems to
take an inordinately long time (even to display no records :) )
Thanks,
Roger
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------