phpbar.de logo

Mailinglisten-Archive

Unterschied PRIMARY KEY/KEY

Unterschied PRIMARY KEY/KEY

Georg Richter mysql-de_(at)_lists.bttr.org
Sun, 24 Feb 2002 08:20:39 +0100


On Saturday, 23. February 2002 16:57, Stefan Hamann wrote:
Moin,
>
> leider gibt mir mein Buch keine Auskunft über den Unterschied zwischen
> KEY und PRIMARY KEY. Wann setze ich KEY ein?

A PRIMARY KEY is a unique KEY with the extra constraint that all key columns 
must be defined as NOT NULL. In MySQL the key is named PRIMARY. A table can 
have only one PRIMARY KEY. If you don't have a PRIMARY KEY and some 
applications ask for the PRIMARY KEY in your tables, MySQL will return the 
first UNIQUE key, which doesn't have any NULL columns, as the PRIMARY KEY.

zu lesen im Manual!

Georg

---
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive