Search
 
SCRIPT & CODE EXAMPLE
 

SQL

find table from column name in sql

SELECT      c.name  AS 'ColumnName'
            ,t.name AS 'TableName'
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name LIKE '%MyName%'
ORDER BY    TableName
            ,ColumnName;
Comment

find tables with column name in sql

SELECT * FROM USER_TAB_COLUMNS WHERE COLUMN_NAME = 'MY_COLUMN'; -- Connected user
SELECT * FROM ALL_TAB_COLUMNS WHERE COLUMN_NAME = 'MY_COLUMN';	-- Other schemas
SELECT * FROM DBA_TAB_COLUMNS WHERE COLUMN_NAME = 'MY_COLUMN';	-- All tables
Comment

find all tables with column name

SELECT
  sys.columns.name AS ColumnName,
  tables.name AS TableName
FROM
  sys.columns
JOIN sys.tables ON
  sys.columns.object_id = tables.object_id
WHERE
  sys.columns.name LIKE '%ColumnName%'
Comment

find a column by name in a sql server table

Get Table by Column Name
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql docker compose 
Sql :: get ip from phpmyadmin 
Sql :: oracle list duplicates 
Sql :: how to create new user and database postgresql in ubuntu 
Sql :: vacuum table postgres 
Sql :: remove binlog mysql 
Sql :: oracle all source 
Sql :: oracle plsql sleep 
Sql :: sql delete caracter list 
Sql :: SET NOCOUNT ON; 
Sql :: how to add CHECK constraint to a column in postgres 
Sql :: truncate statement in sql 
Sql :: order by oracle 
Sql :: how to sort names in alphabetical order in sql 
Sql :: Add SuperUser MySQL 
Sql :: flask sqlalchemy filter multiple conditions 
Sql :: Write a query to create an empty table from an existing table? 
Sql :: mysql database manager 
Sql :: sql server update to null 
Sql :: SQL Count UNIQUE Rows 
Sql :: sql decimal vs float 
Sql :: mysql create database utf8 
Sql :: declare variables sql 
Sql :: how to change a column name in postgresql 
Sql :: 3 days back in sql server 
Sql :: mysql multiple count 
Sql :: oracle select first result 
Sql :: select last 30 days sql 
Sql :: how to combine first and last nae into one columb sql 
Sql :: oracle add time to date 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =