![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? How do you spell indecies??? |
#3
| |||
| |||
|
|
I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? |
#4
| |||
| |||
|
|
On 2010-10-30 03:46, SpreadTooThin wrote: I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? You can create a unique constraint as in alter table t add constraint ... unique (a, b); /Lennart |
#5
| |||
| |||
|
|
I'm using MySQLWorkbench. Do I just check the columns I want as primary keys? Or must it be in the sql script? |
#6
| |||
| |||
|
|
On 10/29/2010 9:46 PM, SpreadTooThin wrote: I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? How do you spell indecies??? Create a unique index on col-a + col-b. And it can either be indicies or indexes - the latter is more commonly used, but the former is more proper. |
#7
| |||
| |||
|
|
In article<iag2n3$uqk$1 (AT) news (DOT) eternal-september.org>, Jerry Stuckle<jstucklex (AT) attglobal (DOT) net> wrote: On 10/29/2010 9:46 PM, SpreadTooThin wrote: I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? How do you spell indecies??? Create a unique index on col-a + col-b. And it can either be indicies or indexes - the latter is more commonly used, but the former is more proper. Since when is a misspelled word "more proper" than a correctly spelled one? The correct spelling is "indices". |
#8
| |||
| |||
|
|
In article<iag2n3$uqk$1 (AT) news (DOT) eternal-september.org>, Jerry Stuckle<jstucklex (AT) attglobal (DOT) net> wrote: On 10/29/2010 9:46 PM, SpreadTooThin wrote: I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? How do you spell indecies??? Create a unique index on col-a + col-b. And it can either be indicies or indexes - the latter is more commonly used, but the former is more proper. Since when is a misspelled word "more proper" than a correctly spelled one? The correct spelling is "indices". |
#9
| |||
| |||
|
|
On 10/30/2010 4:05 PM, Doug Miller wrote: In article<iag2n3$uqk$1 (AT) news (DOT) eternal-september.org>, Jerry Stuckle<jstucklex (AT) attglobal (DOT) net> wrote: On 10/29/2010 9:46 PM, SpreadTooThin wrote: I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? How do you spell indecies??? Create a unique index on col-a + col-b. And it can either be indicies or indexes - the latter is more commonly used, but the former is more proper. Since when is a misspelled word "more proper" than a correctly spelled one? The correct spelling is "indices". Incorrect. http://dictionary.reference.com/browse/index Both are acceptable. Wrong again. "Indicies" is not an acceptable spelling for anything. |
#10
| |||
| |||
|
|
In article <iahuol$gfp$1 (AT) news (DOT) eternal-september.org>, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote: On 10/30/2010 4:05 PM, Doug Miller wrote: In article<iag2n3$uqk$1 (AT) news (DOT) eternal-september.org>, Jerry Stuckle<jstucklex (AT) attglobal (DOT) net> wrote: On 10/29/2010 9:46 PM, SpreadTooThin wrote: I have a table where two or more columns together must be unique. How tell mysql that col-a + col-b must be unique in a row? How do you spell indecies??? Create a unique index on col-a + col-b. And it can either be indicies or indexes - the latter is more commonly used, but the former is more proper. Since when is a misspelled word "more proper" than a correctly spelled one? The correct spelling is "indices". Incorrect. http://dictionary.reference.com/browse/index Both are acceptable. Wrong again. "Indicies" is not an acceptable spelling for anything. |
![]() |
| Thread Tools | |
| Display Modes | |
| |