I have a DB which has a table called config
. This table could possibly have a config_cstm
table that is related by the id to the config table.
I was wondering - is there a way to dynamically check for the existence of this table in one simple select statement?
In other words, something like:
select *
from config
(IF EXISTS config_cstm THEN
LEFT OUTER JOIN config_cstm ON config.id = config_cstm.id_c)
I know how I would go about checking for the existence of an existing table in PHP. I was wanting to do this all in one MySQL statement though.
Any suggestions?