On Tue, May 29, 2012 at 6:05 AM, IQuant <[email protected]> wrote: >>CREATE VIEW TICKMAX >>AS >> SELECT ASK, BID, TRADEPRICE, TIMESTAMP, SYMBOL >> FROM TICKDATA >> WHERE TIMESTAMP = MAX(TIMESTAMP) >>GROUP BY SYMBOL; > > Trying to work through your suggestions: > I'm getting "Misuse of aggregate max()"
With the latest version of SQLite I guess this can be rewritten as CREATE VIEW TICKMAX AS SELECT ASK, BID, TRADEPRICE, MAX(TIMESTAMP), SYMBOL FROM TICKDATA GROUP BY SYMBOL; But note only in SQLite 3.7.11 and later fields ASK, BID and TRADEPRICE will be selected from the row with maximum TIMESTAMP, previous SQLite versions will return values from random row. Pavel _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

