Keith Medcalf, on Monday, January 27, 2020 02:28 AM, wrote... > > > Do you perhaps mean: > > SELECT a.a, > a.c, > a.e, > b.g, > b.h, > b.i, > coalesce(( > SELECT 'YES' > FROM t2 > WHERE wYear == a.c > AND pid == a.a > ), 'NO') AS digital > FROM t0 as a, t1 as b > WHERE a.a == b.f > AND a.idate == (SELECT MAX(idate) from t0 where a = a.a) > AND b.idate == (SELECT MAX(idate) from t1 where f = a.a) > AND a.a IN (SELECT pid FROM t2) > AND a.c == 2020 > ; >
Yep, this one works also. Thanks. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users