잡다한 언어/sql

SQL search same columns

jm_p_op 2023. 2. 18. 14:59

orders & point_users same colums

 

with

table1 as (select column_name from information_schema.columns

where table_name = 'orders'),

table2 as (select column_name from information_schema.columns

where table_name = 'point_users')

select t1.column_name as '중복 테이블' from table1 t1

inner join table2 t2 on t1.column_name = t2.column_name;