harelba / q

q - Run SQL directly on delimited files and multi-file sqlite databases

Home Page:http://harelba.github.io/q/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use NOT LIKE in query?

Pantos opened this issue · comments

I'm very happy to find q to query my csv files. But how can I use NOT LIKE in a query? At the moment it doesn't seem to affect my results when I put it in the WHERE clause. Can anyone give me a hint?

$ seq 1 100 | qq "select * from - where c1 like '%55%'"  | wc -l
1
$ seq 1 100 | qq "select * from - where c1 not like '%55%'"  | wc -l
99

Hope that helps.

Btw, if you're in windows, then the % signs have special meanings, perhaps you'd need to escape them.