Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    87

    Thumbs up Unanswered: query to retrieve primary key

    1)i wanna know the query which retrieves the primary key of a table.

    2)query to retrieve the primary key and table names.


    If anyone knows the query, expecting replies.

  2. #2
    Join Date
    Sep 2003
    Location
    London
    Posts
    56
    To get the tables in a database:

    Code:
    SHOW TABLES ;
    To show the indexes on a table;

    Code:
    SHOW INDEXES FROM  tableName ;
    (You'll have to grab the line with an index name of PRIMARY KEY from that)

    Regards,

    Matt.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •