Hi All,

I'm creating a database which will look a little like:
create table main (f1 TEXT, f2 TEXT, f3 TEXT, t1 TEXT, t2 TEXT, tn TEXT);

f1, f2 and f3 will always be present. Any or all of the ts might be NULL.

I'd like to prevent entries where all of the fields are the same being
created. How can I do this. I've tried experimenting with UNIQUE KEYs but
haven't been successful - perhaps because of the NULLs?

You might try adding NOT NULL to your column constraints and
a default to an empty string in the create table.
I thought UNIQUE implied NOT NULL but I might be
wrong.

Reply via email to