Bug #455 MAX on Order By
Submitted: 20 May 2003 3:06 Modified: 21 May 2003 10:02
Reporter: Giovanni Monferdini Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:Alpha 4.1 OS:Linux (Linux RedHat 7.1 (ODBC Win2k))
Assigned to: Mark Matthews CPU Architecture:Any

[20 May 2003 3:06] Giovanni Monferdini
Description:
I use JDBC/ODBC connector!!

This select give an error!!

SELECT TIME_STAMP,Max(CURR_DATE) FROM TPJBIST WHERE IDBITYPE='AnagConti'
 AND ID_IN='RDS' AND ID_OUT='RDS' AND TIME_STAMP like '%' GROUP BY TIME_STAMP ORDER BY Max(CURR_DATE) DESC
 
If i use an alias for max(CURR_DATE) work but i don't want use an alias!!!

Please Help Me!!

Thanks

How to repeat:
Create the table, insert row and try!!

CREATE TABLE     TPJBIST (
        PROGR           INT          NOT NULL ,
        TIME_STAMP      VARCHAR(14)  NOT NULL ,
        IDBITYPE        VARCHAR(20)  NOT NULL ,
        ID_IN           VARCHAR(20)  NOT NULL ,
        ID_OUT          VARCHAR(20)  NOT NULL ,
        URI             VARCHAR(254) NOT NULL ,
        STATE           VARCHAR(30)  NOT NULL ,
        CURR_DATE       VARCHAR(14)  NOT NULL);

ALTER TABLE TPJBIST TYPE=INNODB;

CREATE UNIQUE INDEX     TPJBIST_KEY1 ON     TPJBIST
   (PROGR    , TIME_STAMP    , IDBITYPE    , ID_IN    , ID_OUT    );
[21 May 2003 10:02] Mark Matthews
Don't use the JDBC:ODBC connector. It is known to be _very_, _very_ buggy. You should always use a JDBC driver provided by your database vendor if you can. In this case, use Connector/J! See http://www.mysql.com/products/connector-j/