List:General Discussion« Previous MessageNext Message »
From:Victoria Reznichenko Date:June 7 2002 4:07pm
Subject:Re: How to sort on multiple columns?
View as plain text  
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
 / /|_/ / // /\ \/ /_/ / /__   Victoria.Reznichenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
How to sort on multiple columns?Tim Johnson7 Jun
  • Re: How to sort on multiple columns?Victoria Reznichenko7 Jun
Re: How to sort on multiple columns?Chris Knipe7 Jun