Re: [sqlite] Re: Need Help with SQL Statement

2007-04-30 Thread [EMAIL PROTECTED]
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 w

[sqlite] Re: Need Help with SQL Statement

2007-04-30 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: I have a file with the columns: StockSymbol, OptionSymbol, StockPrice, StrikePrice, ExpiryDate For each StockSymbol, ExpiryDate, I would like to list just 4 of the records where the StrikePrice is lower than the StockPrice. This should do it: select * from Options o1