Re: [sqlite] Duplicate records (null handling)

2006-06-17 Thread Will Leshner
On 6/17/06, David M. Cook <[EMAIL PROTECTED]> wrote: I took it to mean NULL is distinct from any other value, not that each NULL is distinct from any other NULL. I believe it means that NULL is distinct even with itself. In other words, I believe NULL == NULL is false.

Re: [sqlite] Duplicate records (null handling)

2006-06-17 Thread David M. Cook
On Sat, Jun 17, 2006 at 10:16:47AM -0700, Will Leshner wrote: > But if NULL is distinct for UNIQUE columns, isn't that the result you > would expect? I took it to mean NULL is distinct from any other value, not that each NULL is distinct from any other NULL. Why would one want NULL to behave thi

Re: [sqlite] Duplicate records (null handling)

2006-06-17 Thread Will Leshner
On 6/17/06, David M. Cook <[EMAIL PROTECTED]> wrote: says that nulls are distinct in a column, but I haven't found that to be the case (this is a test with 3.3.5) create table foo (bar text, baz text, unique(bar, baz)); select * from foo; bar|baz quux|null quux|null quux|null But

Re: [sqlite] Duplicate records (null handling)

2006-06-17 Thread David M. Cook
On Thu, Jun 15, 2006 at 02:23:58PM -0500, Jay Sprenkle wrote: > 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. The null handling page http://sqlite.org/nulls.html says t

Re: [sqlite] Duplicate records

2006-06-16 Thread Adam
In message <[EMAIL PROTECTED]>, Jay Sprenkle wrote: > > 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

Re: [sqlite] Duplicate records

2006-06-15 Thread C.Peachment
On Thu, 15 Jun 2006 20:12:41 +0100, Adam wrote: >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 whe

Re: [sqlite] Duplicate records

2006-06-15 Thread Jay Sprenkle
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

[sqlite] Duplicate records

2006-06-15 Thread Adam
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 c