In running the three searches below, I've noticed a few differences in the results, which is fine, since the searches are distinct. However, I was wondering if you could give me a few hints as to why each search returns the count it does.
-----------------------------------------
select count(*) from mytable where myfield like '(tiller,maxey,glisan)'
(1200 hits returned)
-----------------------------------------
select count(*) from mytable where myfield like 'tiller,maxey,glisan'
(7 hits returned)
-----------------------------------------
select count(*) from mytable where myfield like 'tiller' OR myfield like 'maxey' OR myfield like 'glisan'
(1100 hits returned)
-----------------------------------------
I'm particularly interested in learing why there's a large discrepancy between the first and second searches, and how the parens play a role in grouping the terms together. Also, could you highlight in a general way the difference between commas in the search terms and OR connectors? Thanks!
-----------------------------------------
select count(*) from mytable where myfield like '(tiller,maxey,glisan)'
(1200 hits returned)
-----------------------------------------
select count(*) from mytable where myfield like 'tiller,maxey,glisan'
(7 hits returned)
-----------------------------------------
select count(*) from mytable where myfield like 'tiller' OR myfield like 'maxey' OR myfield like 'glisan'
(1100 hits returned)
-----------------------------------------
I'm particularly interested in learing why there's a large discrepancy between the first and second searches, and how the parens play a role in grouping the terms together. Also, could you highlight in a general way the difference between commas in the search terms and OR connectors? Thanks!