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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -