Answers for "MySql get primary keys of table"

SQL
0

MySql get primary keys of table

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'Your Database'
  AND TABLE_NAME = 'Your Table name'
  AND COLUMN_KEY = 'PRI';


SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'Your Database'
  AND TABLE_NAME = 'Your Table name'
  AND COLUMN_KEY = 'UNI';
Posted by: Guest on November-03-2020

Code answers related to "MySql get primary keys of table"

Code answers related to "SQL"

Browse Popular Code Answers by Language