sustainability- energy
sustainability. energy
sustainability/ energy
sustainability; energy
sustainability* energy
sustainability: energy
sustainability, energy
sustainability energy
select * from Title where TitleDescription like '%sustainability energy%'
.So if i run above query its getting the last record only but i need all

Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Oct 8, 2024, 8:35 AM EDT
Hi Pinku,
To retrieve all the variations of the phrase “sustainability energy” in your data, you need to mention the punctuation between the words. Since SQL Server’s LIKE operator does not treat punctuation as equivalent to a space, you'll need to include all possible punctuation marks that could appear between “sustainability” and “energy.”
You can try the below query:
SELECT * FROM Title WHERE (TitleDescription LIKE '%sustainability[ .,/;:*,-] energy%' OR TitleDescription LIKE '%sustainability energy%')Thank you.
Rohit Kumar Srivastava39 reputationPosted Oct 8, 2024, 8:28 AM EDT
Hi you can use _ like below.
select * from Title where TitleDescription like '%sustainability_energy%'
hope it will help you.
PinkuRank #3,922 · 378 reputationPosted Oct 8, 2024, 8:56 AM EDT
Thanks Imran its working.But i have another query.
sustainability- energy
sustainability. energy
sustainability/ energy
sustainability; energy
sustainability* energy
sustainability: energy
sustainability, energy
sustainability energy
lets say there are some data like above. and i want to show all of this but with out Punctuation like below . how to do it.
sustainability energy
sustainability energy
sustainability energy
sustainability energy
sustainability energy
sustainability energy
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Oct 8, 2024, 9:30 AM EDT
If you want to get all without punctuations then you can use a combination of REPLACE functions to remove specific punctuation characters from the TitleDescription field.