On 29 Dec 2009, at 6:29pm, nomorecaddy wrote: > Is it possible to run an SQL query in sqlite that displays columns only on a > condition? For example: > select col1, (case when 1==2 then col2) from myTable > > In this case, I only want to show one column (col1)
I'm not sure I understand your question, but I'll guess. A SELECT command must return the same number of columns in each row. You can use a conditional function to change what appears in each row and your CASE is fine, but you need to correct the syntax: http://sqlite.awardspace.us/syntax/sqlitepg09.htm Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users