On Sun, Jun 20, 2010 at 4:52 PM, P Kishor <punk.k...@gmail.com> wrote: > > No. WHERE clause is a completely different part of the statement, > different from WHEN which is a part of the CASE construct. "CASE.. > WHEN .. THEN .. ELSE .. END" is one construct, an expression, and > applies to the columns, while WHEN is a completely different part.
Thank you, unfortunately I am still 100% clueless as to how to use the CASE ... WHEN ... THEN ... ELSE ... END to solve this pseudo code problem in one SQL statement: prepare "SELECT FolderId, ImageId, instertedon FROM V_FAVORITES_SELECTED WHERE instertedon > julianday(@time)" do(step) { if( findImage(@rootPath, FolderId, ImageId) == 1) break; } Like I said originally, the SQL statement looks like this currently, but the findImage is called on the whole resultset: SELECT FolderId, ImageId, instertedon FROM V_FAVORITES_SELECTED WHERE instertedon > julianday(@time) AND findImage(@path, FolderId, ImageId) = 1 LIMIT 1 I would REALLY appreciate it if someone could show me EXACTLY what it should look like, sometimes the switch from C/C++ to SQL is a bit too much for me:) Sam _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users