unlike

select o.orderid,o.shipaddress1,o.shipaddress2,n.note
from orders o left join notes n on o.orderid=n.orderid
where n.note like '%' + o.shipaddress1 + '%' order by orderid desc

works but I want THE OPPOSITE

i want to select rows where n.note DOES NOT contain the value of o.shipaddress1

is there a
unlike
notlike

command
LVL 1
rgb192Asked:
Who is Participating?
 
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
Use NOT LIKE as given below:

select o.orderid,o.shipaddress1,o.shipaddress2,n.note
from orders o left join notes n on o.orderid=n.orderid
where n.note not like '%' + o.shipaddress1 + '%' order by orderid desc
0
 
rgb192Author Commented:
thanks
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Welcome..
0
All Courses

From novice to tech pro — start learning today.