Answers for "select column names from table mysql as it is in table"

SQL
3

mysql get column names from table

SELECT `COLUMN_NAME` 
FROM `INFORMATION_SCHEMA`.`COLUMNS` 
WHERE `TABLE_SCHEMA`='yourdatabasename' 
    AND `TABLE_NAME`='yourtablename';
Posted by: Guest on December-18-2020
0

mysql select all table that have field names

SELECT DISTINCT
	TABLE_NAME
FROM
	INFORMATION_SCHEMA.COLUMNS
WHERE
	COLUMN_NAME IN('column1', 'column2')
	AND TABLE_SCHEMA = 'schema_name';
Posted by: Guest on November-12-2020

Code answers related to "select column names from table mysql as it is in table"

Code answers related to "SQL"

Browse Popular Code Answers by Language