Josh,
I've taken your advise and ordered a book, but until that arrives,
one further question, if you don't mind:
On Friday 08 February 2002 17:49, Josh Berkus wrote:
>
> > 2a) If so - If I define two or more columns as the primary key, will
> > they
> > be indexed seperately, or do I need to index the 2nd and 3rd
> > columns
> > seperately
>
> They will be indexed together. So, if you need to do lookups on the
> 3rd column seperate from the 1st, you will need to build a seperate
> index for that column alone.
>
If I need to lookup on a combined key, how do I do that ?
The CREATE TABLE syntax doesn't seem to allow me to combine the columns into a single key name.
Additionally, if I combine two VARCHAR columns are the following keys unique ?
...
a VARCHAR(10),
b VARCHAR(10),
PRIMARY KEY (a,b),
...
a="abc", b="def"
a="ab", b="cdef"
If not, would I need to make a CHAR(10) rather than VARCHAR(10), or is there some other trick ?
Thanks
JohnT