MySQL Forums
Forum List  »  General

Re: Select from where? (Primary keys?)
Posted by: Margaret MacDonald
Date: February 12, 2005 02:33PM

You can do what you're trying to do, but it'll be more work than a single statement. You have to first issue a DESCRIBE query on the table. That will return a dataset with a record for each field (do a DESCRIBE on a table in the commandline window and you'll see the format). Once you have that dataset, loop through each of the field-description records looking for "PRI" in the 'key' field. When you find that, you can get the fieldname from the "Field" field and go on from there.

Options: ReplyQuote


Subject
Written By
Posted
Re: Select from where? (Primary keys?)
February 12, 2005 02:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.