Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #MySql #primary #keys #table
ADD COMMENT
Topic
Name
9+2 =