On Sun, 2005-05-22 at 19:42 -0400, Al Danial wrote: > then try queries such as > > sqlite baseball.db 'select playerid,sb from batting where sb = (select > max(sb) from batting where playerid in (select playerid from fielding > where pos = "3B" and lgid = "NL"));' > > which tries to answer the question "which National League third > baseman had the most stolen bases in a season?" Then again, > the query could be slow because I didn't formulate it correctly. -- Al >
The use of double-quotes instead of single-quotes is confusing the optimizer somehow. (I'm still looking why this is.) SQL (not just SQLite but the SQL language in general) really wants you to use single quotes. If you change "NL" to 'NL' the query will go very quickly, even without creating any indices. -- D. Richard Hipp <[EMAIL PROTECTED]>