On Tue, Jun 14, 2016 at 8:47 AM, James K. Lowden <jklow...@schemamania.org> wrote:
> On Mon, 13 Jun 2016 19:11:29 +0000 > "Drago, William @ CSG - NARDA-MITEQ" <william.dr...@l-3com.com> wrote: > > > I need UNIQUE(B, C) only when E=0. > > A conditional constraint is evidence that you have two kinds of things > represented in one table: those E=0 types that are identified by {B,C}, > and the rest. They're represented in a single table because they > seem to have the same columns, although the E=0 types don't need an E > column. > > A better solution might be to separate the two types into to two > tables, each with its own constraints, and use a UNION to represent > them as one. > > --jkl > I was thinking the same thing, but couldn't phrase it as well as you did. But I have this unusual(?) habit of liking to do things "by the book", which in this case tends to be "Database Design & Relational Theory" and "SQL and Relational Theory", both by Dr. C. J. Date . Also tend to be more a theorist than an actual "real world" practitioner. I.e. I favor design over performance more than I should. -- "Pessimism is a admirable quality in an engineer. Pessimistic people check their work three times, because they're sure that something won't be right. Optimistic people check once, trust in Solis-de to keep the ship safe, then blow everyone up." "I think you're mistaking the word optimistic for inept." "They've got a similar ring to my ear." From "Star Nomad" by Lindsay Buroker: Maranatha! <>< John McKown _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users