Arkawa72
asked on
Sql select query
I have a question about a select query.
I have a table with three columns (NAME, CITY, COUNTRY)
I would like to select all rows except the USA, But I would like to include New York City.
How can I do this in one select query?
I have a table with three columns (NAME, CITY, COUNTRY)
I would like to select all rows except the USA, But I would like to include New York City.
How can I do this in one select query?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why use 'like' when an equality check will do?
'like' is for wildcard use. It will work but might mess with the optimizer.
'like' is for wildcard use. It will work but might mess with the optimizer.
ASKER
So if you have the line John, New York City, USA.
Does this line get included because it is in New York or does it get excluded because it in the USA
Sorry for the beginnner-level question. I am pretty new to SQL
Does this line get included because it is in New York or does it get excluded because it in the USA
Sorry for the beginnner-level question. I am pretty new to SQL
yes, the record will be seen in the output
yep, LIKE will be little slower
because the wildcards requires additional processing
because the wildcards requires additional processing
Open in new window