"NULL" means unknown, so you can't say if another value = NULL, it may or may 
not - the db can't tell.

Instead of "=" there is usually an "isnull" or "is null" operator in your 
database to test for null, 
in your case, try:update "mc-roadsegs" Set "RFROMHN" = "" Where "RFROMHN" is 
null;
(I use Postgis rather than Spatialite, which would use ' instead of " to define 
strings, so:update "mc-roadsegs" Set "RFROMHN" = '' Where "RFROMHN" is null;)
HTH,
  Brent Wood

      From: Chuck Young <[email protected]>
 To: [email protected] 
 Sent: Sunday, March 15, 2015 10:57 AM
 Subject: [Qgis-user] SQL to update table
   
I am trying to eliminate the text "NULL" from a table.  I have imported a set 
of Tiger road data and in some of the columns that I need to display the data 
itr has "NULL" in the field.  If it is Null I would really like that NOT to 
show up in the labeling on the map.

I have tried some standard SQL update queries but they didn't work.  

I tried the following from the QSpatialite form that appears from within QGIS. 
Example:
update "mc-roadsegs" Set "RFROMHN" = "" Where "RFROMHN" = "NULL";

I also tried to construct a query from within the query builf=der at the top of 
the Attribute table in Edit mode.

I really need to remove these unwanted valued.  It has been a while since I 
used SQL on a routine basis so I am a bit rusty.  

Any help will be much appreciated!

Thanks

Chuck

_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

  
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to