Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql common columns

-- NB: Applicable for Oracle and PL/SQL only

select * 
from all_tab_cols A
where 
   A.COLUMN_NAME in 
   (
      select B.column_name
      from all_tab_cols B
      where B.table_name = 'YourFirstTable'
   )
   and A.table_name != 'YourFirstTable'
   and A.TABLE_NAME = 'YourSecondTable';
Comment

PREVIOUS NEXT
Code Example
Sql :: postgres delete all tables 
Sql :: display 2 numbers after decimal mysql 
Sql :: postgres set column based on another column 
Sql :: creating a table in sql 
Sql :: min salary in sql 
Sql :: sqlalchemy join on column 
Sql :: select count 
Sql :: postgresql export database 
Sql :: sql mm/dd/yyyy format 
Sql :: savepoint in sql 
Sql :: mysql drop database 
Sql :: 3 days back in sql server 
Sql :: postgresql set auto increment value 
Sql :: Mysql Create table with foreign keys. 
Sql :: mysql count with if 
Sql :: how to get the date from datetime in mysql 
Sql :: show table postgres command 
Sql :: mysql date range 
Sql :: referential integrity constraint 
Sql :: oracle revoke 
Sql :: how to identify locked tables in sql server 
Sql :: restroe pg_dump example 
Sql :: sql server case sensitive search 
Sql :: how to insert multiple rows in sql 
Sql :: how to query date in sql server 
Sql :: sql command to show all tables 
Sql :: check database size in gb mysql 
Sql :: Inner join - to join 3 tables - https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-inner-join/ 
Sql :: sql right join with where clause 
Sql :: mysql run sql file 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =