Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keys vs. Primary Keys.

Status
Not open for further replies.

jxfish2

Technical User
Jan 24, 2002
183
US
I'm new to MySQL, and for the time being, have setup some very basic databases, using the Webmin frontend.

In Webmin, each field created can be selected as a "Primary Key".

There is no reference to just a plain "Key", or sort key...

Can you have multiple "Primary Keys" in a single table?

If not, how can I set certain fields up as sort keys, from the command line, after the field has already been created?

Or do I need to forget the Webmin frontend, and create sort key fields strictly from the command line?

TIA

JCF
 
You can have only one primary key in a table, but you can have as many sub-ordinate keys as you want.

However, I think that it's just as easy to create your sort in your SQL statement and unless you have 100's of 1000's of rows of data, you won't see much performance loss. There's always a better way...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top