0

I am having trouble excluding text in a field that starts with "Community Launch". I am using the code:

rp.project_name NOT LIKE 'Community Launch%'

but this is removing any text that also has Community in it. I need for it to remove text that starts with Community Launch.

I have tried different variations and searched, but I am unable to resolve.

8
  • try: SELECT * FROM your_table rp WHERE rp.project_name NOT LIKE 'Community Launch%' COLLATE Latin1_General_CI_AS AND LTRIM(RTRIM(rp.project_name)) = rp.project_name Commented Jun 4, 2024 at 12:38
  • 3
    The condition actually looks OK. Can you share some sample data and the expected vs actual result you're getting? Commented Jun 4, 2024 at 12:47
  • 2
    NOT LIKE should of course work too. However, I can't see why your query doesn't work as expected. Provide a minimal reproducible example, showing the problem. And a prepared dbfiddle.uk would be great. Commented Jun 4, 2024 at 12:47
  • 2
    @ErgestBasha Why shouldn't they use NOT LIKE? Commented Jun 4, 2024 at 13:10
  • 2
    Either way we cannot reproduce this dbfiddle.uk/1MKOIcuQ please give a minimal reproducible example Commented Jun 4, 2024 at 13:25

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.