jason jason - 4 years ago 98
SQL Question

SQL Query that contains a URL

I have the query below. I want to receive records that doesn't include

mywebsite.com/url
but that includes
mywebsite.comurl
:

SELECT COUNT(*)
FROM [mydb].[dbo].[mytable]
WHERE No is not null
AND Thumbnail is not null
AND Thumbnail not like '<a target=\"_blank\" href=\"http://www.mywebsite.com/%'


When I run the query, it gives me an unexpected number. What is wrong with the query, how can I make it work correctly?

Answer Source
 SELECT COUNT(*) FROM [mydb].[dbo].[mytable] WHERE No is not null
 AND Thumbnail is not null
 AND Thumbnail like '%mywebsite.com%'
 AND Thumbnail not like '%mywebsite.com/url%' 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download