Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Unique index on column with null values


Tourex - 11:00 am on Nov 17, 2011 (gmt 0)


Hi Guys

I know the answer is going to be blindingly obvious, but for the life of me, it is escaping my tired old mind.

I need to store customer details in a MySQL database. Although primary access will be through a unique system-generated auto-incrementing key, customer access will be via the email address. However, the table contains records for which we have no email address. So, how can I create a unique key on the email field to prevent duplication when various records have null values in that field?

Any help will be much appreciated. Thanks!


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4387993.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com