Re: SQL CASE WHEN THEN ELSE END

Jose Isaias Cabrera <[email protected]>
Newsgroups gmane.comp.db.sqlite.general
Message-ID <VI1P195MB07651B7D6BE1ACF421158A98DE0B0@VI1P195MB0765.EURP195.PROD.OUTLOOK.COM>
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
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.