# How to search text string and select item in QGIS?

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.

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

• Do you want to select them for extraction or an operation; or do you want to just colour them? – Nathan W Jul 3 '13 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 '13 at 9:53
• You can find the solution reading the comment below (use % instead of *) – Ale Jul 5 '13 at 7:42

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

"ROAD NAME" LIKE '%1%'

• 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 '13 at 9:55
• @NathanW neither with LIKE. I understand that the difference between LIKE and ILIKE is only that ILIKE is not case sensitive – Ale Jul 4 '13 at 12:21
• @Giulio Have you tried % instead of *? – underdark Jul 4 '13 at 19:23
• @Catlike as far as I remember the comparison tools are case-sensitive – underdark Jan 2 '14 at 20:11
• @Catlike, if you want the search to be insensitive to case use 'ILIKE' instead of 'LIKE' as per the comment above. – EcologyTom Nov 8 '16 at 19:05