Re: [sqlite] replacing several nested queries and UNION ALLs with one query

2012-02-20 Thread Gerry Snyder
a2 != '' seems redundant when a1 = a2 and a1 != '' ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] replacing several nested queries and UNION ALLs with one query

2012-02-19 Thread Simon Slavin
On 20 Feb 2012, at 1:37am, Puneet Kishor wrote: > Say I have table like so > > CREATE TABLE t ( > a1, a2, > b1, b2, > c1, c2 > ); > > I want > > a1 AS foo WHERE a1 != '' AND a2 != '' AND a1 = a2 > > from the remaining

[sqlite] replacing several nested queries and UNION ALLs with one query

2012-02-19 Thread Puneet Kishor
Say I have table like so CREATE TABLE t ( a1, a2, b1, b2, c1, c2 ); I want a1 AS foo WHERE a1 != '' AND a2 != '' AND a1 = a2 from the remaining b1 AS foo WHERE b1 != '' AND b2 != '' AND b1 = b2