Not in straight SQL. If you are sending the SQL query from another programming language, you can selectively add the condition to the query based on the table definition. You can either hard-code the table definition in the program, or get it by querying the database for the table definition.
Hell, if that's the only thing changing the query, you could just have a list of table names with a boolean flag indicating if the country
column is present.
(There is a solution to this problem in straight SQL, but it's extremely janky and therefore not recommended. It involves querying information_schema.tables
, generating the SQL statements in a file, and then running the file. Very, very not recommended.)