Attribute table : How to select more then one feature?

I have a vector layer: ROADS that is composed of different types of roads: primary, secondary, tertiary, trunk, etc.

When I right click on the layer ROADS and I go to Attribute table -> Select by expression -> the column where I want to do the selection: highway -> I wrote this:

"highway" ILIKE '%primary%' OR "highway" ILIKE '%secondary%' OR "highway" ILIKE '%tertiary%' OR "highway" ILIKE '%trunk%' NOT "highway" ILIKE '%trunk_link%'


Till NOT "highway" ILIKE '%trunk_link%' the selection is working well. I can see all the roads that starts with primary, secondary, tertiary and trunk. So also trunk_link -> I don't want that. To erase it from the selection I add NOT "highway" ILIKE '%trunk_link%'. It didn't work -> suddenly I had O selected lines .

Do anyone knows the solution to my problem?

You need to connect the parts with AND or OR.

(
"highway" ILIKE '%primary%'
OR "highway" ILIKE '%secondary%'
OR "highway" ILIKE '%tertiary%'
OR "highway" ILIKE '%trunk%'
)

• You probably could also just do ... OR "highway" ILIKE 'trunk' and forget about the last bit. – Matthias Kuhn Jun 10 '16 at 14:59
• Sure, if there are also other trunk% attributes you are right. In general, try to use the % only where necessary, this way you are more precise and faster. I also usually just put some extra brackets even when not strictly required because I tend to forget if AND or OR takes precedence so I make the job easier for myself in the future. – Matthias Kuhn Jun 10 '16 at 16:55