0

Can I find same parts of strings values in SQL? Also this parts should be more then one character. For example in in column with values

good table
excellent book
nice table
bad chair
nice magazine

It should find table and nice. I'm not sure maybe Like + Regex can help with it.

4
  • 4
    Please provide sample data, desired results, a tag for the database you are using and a clear explanation. Commented Sep 3, 2020 at 11:55
  • Like would be completely enough. Commented Sep 3, 2020 at 11:57
  • Do you know upfront what parts you are looking for? For instance do you know that you are looking for "table" specifically, or are you looking for re-occuring patterns Commented Sep 3, 2020 at 12:12
  • I understood thet explain task incorrect, so other example or this: if i have colums of emails and i want count their domains, like '[email protected]' '[email protected]' '[email protected]' '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]' and i want result table like '@gmail.com' 5 '@hotmail.com' 2 '@mail.net' 2 Commented Sep 3, 2020 at 12:38

1 Answer 1

1

Please, read my comment to the question.

Try this:

SELECT Column1
FROM YourTable
WHERE Column1 Like '%table%' OR Column1 Like '%nice%'

This should return: good table, nice table, nice magazine

More: SQL Like Operator

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.