Just started using QGIS and a bit stuck on SQL or filter if anyone can assist please.
Table is labelled "SL" with multiple data columns. "ID" is the column of interest containing 10’s of thousands of location ID’s in the format of LOC00002345, LOC00002346 ..... and so on.
I need to set up an SQL or filter in QGIS that will return only the listed LOC ID’s. The list can vary in size and in the LOC ID’s needed.
Used to use the following in MapInfo but doesn’t work in QGIS.
ID = any("LOC00001234","LOC00001235","LOC00001236","LOC00001238","LOC00001250")
1 Answer 1
If you want to match certain elements, you can use the following expression in the Query Builder:
ID IN ('LOC00001234','LOC00001235','LOC00001236')
Or, if you want all of them which start with LOC
, then use:
ID LIKE 'LOC%'
-
-
ID = ANY('LOC00001234','LOC00001235','LOC00001236')
would work, too.pLumo– pLumo2018年06月13日 06:20:08 +00:00Commented Jun 13, 2018 at 6:20
" != "
, but anyways, in this case you should use'
.