Reputation: 67
I have a varchar column "category" with several values:
1.1
1.1.1
2.1
2.2.2
3.1.2.1
Now I want to select all columns with only one "." (dot) in it's value.
But "...WHERE category
regexp '[.]{1}'..." does not work, even if I escape the "." with a backslash.
Thanks in advance. Matty
Upvotes: 0
Views: 16
Reputation: 1269763
Just use like
:
where category like '%.%' and category not like '%.%.%'
Upvotes: 3