List:General Discussion« Previous MessageNext Message »
From:Tim Johnson Date:June 7 2002 4:05am
Subject:How to sort on multiple columns?
View as plain text  
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 <tim@stripped>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.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