ba************@yahoo.com (Babu) wrote in
news:bc*************************@posting.google.co m:
select *From titles
(18 row(s) affected)
Totally 18 records are there in Titles table.
When I query
select title,title_id From titles where title like 'T%' and title_id
like 'M%'
It is returning 2 records.
So,now if I introduce a not in 2 places also it should return 16
records.
Whereas it is returning 14 records. What is the bestway to understand
this.
select title,title_id From titles where title not like 'T%' and
title_id not like 'M%'
Thanks
Ganesh
Apparently two of your records satisfy one but not both of the LIKE
clauses; therefore they are not included in your latter statement.
.... where title like 'T%' and title_id like 'M%' : 2 records
.... where title not like 'T%' and title_id not like 'M%' : 14 records
.... where not (title like 'T%' and title_id like 'M%): 16 records
--
Ross Presser -- rpresser AT imtek DOT com
"... VB is essentially the modern equivalent of vulgar Latin in 13th
Centurary Europe. Understand it, and you can travel to places you never
heard of and still understand some people." -- Alex K. Angelopoulos