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

Popular posts from this blog

java - Bypassing "final local variable defined in an enclosing type" -

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -