0

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

1 Answer 1

3

Just use like:

where category like '%.%' and category not like '%.%.%'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.