How to check a value exists in which table in SQL? -
How to check a value exists in which table in SQL? -
i have 2 tables identical columns, table , table b , both have column id. have value of id 'abc'. how check abc exists in id column of table? need output table name.
select 'a' table_name dual exists( select 1 id = 'abc') union select 'b' dual exists( select 1 b id = 'abc')
dual
kind of placeholder can use, if don't have table select from.
sql
Comments
Post a Comment