How to amatch whole word in SQL

sql

Problem:
How to match whole word in SQL.

We very frequently face the requirement to match an entire word, while developing the website/application.

Solution:
This problem can be very easily handled by Microsoft SQL query.
For example when you search for “ram”, if you use “%ram%” it will also match “programme”.

To resolve this, we can use regular expression like syntax in SQL.
The below query will only return the title having “ram” and not “programme”.

select title from article where ‘ ‘+title like ‘%[ ]ram[ ]%’

Additionally we also can provide extra characters to match after word like
select title from article where ‘ ‘+title like ‘%[ -_]ram[ .-_]%’

Enjoy working with SQL.More

SAVE YOUR TIME AND MONEY

Save your time and money by choosing us, a scalable team with 120+ professionals with expertise in various domains and technologies.

Dedicated TL / PM with Quick Response

Have a dedicated Team Lead / Project Manager for your each project, all with an assurance that your project will get utmost priority, along with the quick and firm response for all your queries regarding it.

QUICK, SECURE AND SWIFT CODE

With expertise on all the latest architectural and coding structures, our experienced developers ensure that the site is secure, and performs quick and swiftly.

Leave us your info

Select Service

Describe your requirement here

Upload An Attachment