0

I know I can use wildcards such as % with sql's LIKE. Besides this, are there any advantages of LIKE over a simple equal sign?

So, has this:

SELECT * FROM places WHERE MATCH (postal_code, place_name, admin_name1) 
AGAINST ('+hills' IN BOOLEAN MODE) 
AND admin_code1 LIKE 'CA'

any advantages over this code:

SELECT * FROM places WHERE MATCH (postal_code, place_name, admin_name1)
AGAINST ('+hills' IN BOOLEAN MODE) 
AND admin_code1 = 'CA'
0

as far as I know, they would return the same result in this case, but the second query may execute faster because it compares the values directly while the first would supposedly do pattern-matching (sort of more general and more complex comparison). it might be the case though that a good database management system would detect that an = is more appropriate in this case and use it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .