[Qgis-user] Query expression bugs with NULL Values

Jürgen E. Fischer jef at norbit.de
Thu Mar 26 02:53:24 PDT 2015


Hi José,

On Thu, 26. Mar 2015 at 10:19:10 +0100, José Carlos Martínez Llario wrote:
> "amenity"  <>  'restaurant' returns 37 rows
> "amenity"  =  'restaurant'  returns 11 rows
> 
> The layers has 48 NULL values, so it means that amenity"  <>
> 'restaurant' does not take into account the null values.
> Hope this is a bug and not the correct behaviour.

It's the correct behaviour.   NULL <> 'restaurant' is NULL, ie. not true.

Use eg. coalesce('amenity','') <> 'restaurant'


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden             http://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode                         
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150326/edd831fb/attachment.sig>


More information about the Qgis-user mailing list