Re: How to sort on multiple columns?

2002-06-07 Thread Victoria Reznichenko

Tim,
Friday, June 07, 2002, 7:05:40 AM, you wrote:

TJ> I am using
TJ> mysql  Ver 11.15 Distrib 3.23.41, for redhat-linux-gnu
TJ> on RH 7.2

TJ> I would like to sort on multiple columns, but Mysql
TJ> tells my that the specified key would be too long
TJ> (error 1071).
TJ> If this is the case, what might be an alternative 
TJ> strategy?

TJ> Specifically, here is an example table with description:

TJ> describe CL0420;
TJ> +--+-+--+-+-+---+
TJ> | Field| Type| Null | Key | Default | Extra |
TJ> +--+-+--+-+-+---+
TJ> | ID   | int(11) | YES  | | 0   |   |
TJ> | Producer | char(255)   | YES  | MUL | NULL|   |
TJ> | Varietal | char(255)   | YES  | MUL | NULL|   |
TJ> | Vineyard | char(255)   | YES  | MUL | NULL|   |
TJ> | Year | char(50)| YES  | | NULL|   |
TJ> | Size | char(255)   | YES  | | NULL|   |
TJ> | Average  | int(11) | YES  | | 0   |   |
TJ> | Sold | smallint(6) | YES  | | NULL|   |
TJ> +--+-+--+-+-+---+

TJ> I'd like to sort on Producer, Varietal, Vineyard
TJ>   (in that order)
TJ> I would also appreciate being pointed towards appropriate
TJ> documentation as well.

Hm.. It's a very strange..
I can't reproduce it on my box. You gave incomplete info about your
indexes. Can you show me the output of CREATE TABLE and show your
SELECT statement?

TJ> Best Regards




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to sort on multiple columns?

2002-06-06 Thread Chris Knipe

> > describe CL0420;
> > +--+-+--+-+-+---+
> > | Field| Type| Null | Key | Default | Extra |
> > +--+-+--+-+-+---+
> > | ID   | int(11) | YES  | | 0   |   |
> > | Producer | char(255)   | YES  | MUL | NULL|   |
> > | Varietal | char(255)   | YES  | MUL | NULL|   |
> > | Vineyard | char(255)   | YES  | MUL | NULL|   |
> > | Year | char(50)| YES  | | NULL|   |
> > | Size | char(255)   | YES  | | NULL|   |
> > | Average  | int(11) | YES  | | 0   |   |
> > | Sold | smallint(6) | YES  | | NULL|   |
> > +--+-+--+-+-+---+
> >
> > I'd like to sort on Producer, Varietal, Vineyard
> >   (in that order)
>
> SELECT * FROM CL0420 ORDER BY Producer, Varietal, Vineyard;
>
> That *should* work ?





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




How to sort on multiple columns?

2002-06-06 Thread Tim Johnson

Hello All:
I am using 
mysql  Ver 11.15 Distrib 3.23.41, for redhat-linux-gnu
on RH 7.2

I would like to sort on multiple columns, but Mysql
tells my that the specified key would be too long
(error 1071).
If this is the case, what might be an alternative 
strategy?

Specifically, here is an example table with description:

describe CL0420;
+--+-+--+-+-+---+
| Field| Type| Null | Key | Default | Extra |
+--+-+--+-+-+---+
| ID   | int(11) | YES  | | 0   |   |
| Producer | char(255)   | YES  | MUL | NULL|   |
| Varietal | char(255)   | YES  | MUL | NULL|   |
| Vineyard | char(255)   | YES  | MUL | NULL|   |
| Year | char(50)| YES  | | NULL|   |
| Size | char(255)   | YES  | | NULL|   |
| Average  | int(11) | YES  | | 0   |   |
| Sold | smallint(6) | YES  | | NULL|   |
+--+-+--+-+-+---+

I'd like to sort on Producer, Varietal, Vineyard
  (in that order)
I would also appreciate being pointed towards appropriate
documentation as well.

Best Regards
-- 
Tim Johnson <[EMAIL PROTECTED]>
  http://www.alaska-internet-solutions.com
  http://www.johnsons-web.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php