[Qgis-user] DB Manager query: Can't get CASE WHEN to work

Bernd Vogelgesang bernd.vogelgesang at gmx.de
Sat Dec 7 10:04:06 PST 2019


Ok, sorry for the noise!
comma missing after select *

SQL and me not going to be good friends

Cheers,
Bernd

Am 07.12.19 um 18:47 schrieb Bernd Vogelgesang:
> Hi,
>
> maybe it's again some strange local issue, but I can't find a way to
> make CASE WHEN working in a DB Manger query or in a Vitual Layer.
>
> The example is analog to https://www.sqlitetutorial.net/sqlite-case/
> I would like to populate a new column "category" in that select
>
> SELECT *
>
> CASE WHEN status = 'v' THEN 'v'
>
>     ELSE 'nv'
>
> END category
>
> FROM
>
> table;
>
> Whatever I try, the result is always a:
>
> near "CASE": syntax error
>
> This should have been the preparation for a much more complex query,
> but I even fail at the start :(
>
> Any ideas whats wrong?
>
> Cheers,
>
> Bernd
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20191207/09d5f596/attachment.html>


More information about the Qgis-user mailing list