4

I have a table attribute with complete roads name. I have to search items by digiting a part of the road name and I need to colour all the items selected.

eg: ROAD NAME: / road 01 / road 02 / road 11 / road 12

I need to colour all items that contain "1" (so all the items except the second one). I would like to set the string operator is this way: ROAD NAME ILIKE ' * 1 * ' but it does not work

edit I work in advanced search in table attribute

3
  • Do you want to select them for extraction or an operation; or do you want to just colour them?
    – Nathan W
    Jul 3, 2013 at 22:39
  • I only need to search some items on the project, so for my aim it is enough to colour them on the screen.
    – Ale
    Jul 4, 2013 at 9:53
  • You can find the solution reading the comment below (use % instead of *)
    – Ale
    Jul 5, 2013 at 7:42

1 Answer 1

16

if the attribute is called ROAD NAME, the query should be

"ROAD NAME" LIKE '%1%'
9
  • I have also tried this way but I think that the problem is on the second part of the query. This query works (ROAD NAME ILIKE 'road 01') while this query do not works (ROAD NAME ILIKE ' * 1 * '). It seems it do not recognize the char * as I need.
    – Ale
    Jul 4, 2013 at 9:55
  • 1
    @NathanW neither with LIKE. I understand that the difference between LIKE and ILIKE is only that ILIKE is not case sensitive
    – Ale
    Jul 4, 2013 at 12:21
  • 2
    @Giulio Have you tried % instead of *?
    – underdark
    Jul 4, 2013 at 19:23
  • 2
    @Catlike as far as I remember the comparison tools are case-sensitive
    – underdark
    Jan 2, 2014 at 20:11
  • 1
    @Catlike, if you want the search to be insensitive to case use 'ILIKE' instead of 'LIKE' as per the comment above.
    – EcologyTom
    Nov 8, 2016 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.