I am working on the following query:Find the country where the capital is the country plus "City". Hopefully, you can infer what I mean:
The following query will solve such:
SELECT world.name
FROM world
WHERE world.capital LIKE CONCAT(world.name, " City")
Now, say that I also wanted to match for another word, Town. We could do something like this:
SELECT world.name
FROM world
WHERE world.capital LIKE CONCAT(world.name, " City") OR world.capital LIKE CONCAT(world.name, " Town")
Can I condense the above statement to only one LIKE clause? Say something like this?
SELECT world.name
FROM world
WHERE world.capital LIKE CONCAT(world.name, " [City,Town]")
I just want a more terse SQL statement
mysql,postgresql,sql-server,oracleordb2- or something else entirely.