• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 47
  • Last Modified:

SQL Server 2012 Row Selection

I need to select rows without Blender in the name. I have used the not like operator but it seems not to be working.
Screenshot--883-.png
0
Rob Fried
Asked:
Rob Fried
2 Solutions
 
Pawan KumarDatabase ExpertCommented:
try
SELECT SerialNo,Name,Cost
FROM Equipment
WHERE Cost < 2000 AND name NOT LIKE '%blender%'

Open in new window

0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
^^^  Your T-SQL NOT LIKE was missing the wildcard characters % that are present in the above query.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now