Basics of a similar operator

how to write a request to get a five-letter pattern. I have a question: List all the name of the Client whose names are formed in exactly 5 letters. I wrote a query like this:

SELECT ContactName
From Customers
 WHERE ContactName LIKE '[A-Z][A-Z][A-Z][A-Z][A-Z]'

thank

+4
source share
2 answers
SELECT ContactName
FROM Customers
WHERE LEN(ContactName) = 5
0
source
SELECT ContactName
From Customers
WHERE ContactName LIKE '_%_%_%_%_%'

Any character 5 in length

-2
source

Source: https://habr.com/ru/post/1694144/


All Articles