> > > It can't have anything to do with the 'uniqueness' of the data, since
I
> can
> > > have a lot of 'zero'-values in the column, as long as the combination
of
> > > columns in the PRIMARY key results in unique values.
> >
> > Because it is a PRIMARY KEY.  I mean phrase 'PRIMARY KEY' means "a key
> > with which each row can be explicitly addressed".  So if you have 2000
> > rows in a table, you can write 2000 SELECT statemens which will use
> > columns in primary key and each of these SELECT statements will
> > return exactly one (different) row.
> With the NULL values included it will still uniquely identify each row...
>
> I would understand it if it would mean that the key as a whole could not
be
> NULL, but the restriction that each column that is part of a PRIMARY KEY
> must have the NOT NULL constraint is not logical.

It isn't?

Imagine this:

mytable with PK
(id, value)

1, NULL
1, NULL
2, value
2, NULL

now, given that NULL <> NULL ... what row would 1, NULL identify?

Or would you only allow a single NULL for each part of the PK?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to