I am looking for the query that will give me the name of the attribute that is the primary key of the table.
Primary Key finding
Collapse
X
-
But, i want a query that take table name and return the attribute name having primary key not the any other key..
Originally posted by mwasifDESCRIBE will display the whole table structure and SHOW KEYS will display the keys. The syntax is
Code:DESCRIBE table_name;
Code:SHOW KEYS FROM table_name;
Comment
-
Originally posted by pbmodsHeya, vaani.
When you DESCRIBE your table, the primary key will have a value of 'PRI' in the `Key` column.
But the query you gave is not exceptable in MySQL. Every time i am trying to execute the query, it is giving error....
Please HELP!!!Comment
-
Originally posted by r035198xWhich query did you try and what error did you get?
I am usingCode:sp_helpconstraint Account
I want to find the name of the column that is having primary key...
Please Please HELP!!!Comment
Comment