From: [EMAIL PROTECTED]
To:   [EMAIL PROTECTED]
Subject: invalid order when use 2 fields in ORDER BY

Description:
    I try to show data by use "SELECT ... ORDER BY ...",
but sometime! I get wrong order list when I try use 2 field in ORDER BY 
cause

How-To-Repeat:
    I show 2 results, they use SAME QUERY and SAME DATA to execute.

mysql> SELECT id, day, CONCAT(time_b, '-', time_e) AS time, IFNULL(room, 
room_cs) AS room,
fg_color, bg_color, teacher, staff, comment FROM course_time
WHERE code = 418112 AND section = 14 AND class = 'Lab' ORDER BY day ASC, 
time_b ASC ;

+----+-----------+-------------+--------+----------+----------+---------+-------+---------+
| id | day       | time        | room   | fg_color | bg_color | teacher 
| staff | comment |
+----+-----------+-------------+--------+----------+----------+---------+-------+---------+
| 15 | Monday    | 12:00-12:30 | SCL301 | 000000   | FFFF33   |         
|       |         |
| 12 | Wednesday | 08:00-10:00 | SCL301 | 000000   | FFFF33   |         
|       |         |
| 14 | Wednesday | 10:00-11:00 | SCL301 | 000000   | FFFF33   |         
|       |         |
+----+-----------+-------------+--------+----------+----------+---------+-------+---------+
3 rows in set (0.00 sec)

and sometime I got wrong order...
+----+-----------+-------------+--------+----------+----------+---------+-------+---------+
| id | day       | time        | room   | fg_color | bg_color | teacher 
| staff | comment |
+----+-----------+-------------+--------+----------+----------+---------+-------+---------+
| 15 | Monday    | 12:00-12:30 | SCL301 | 000000   | FFFF33   |         
|       |         |
| 14 | Wednesday | 10:00-11:00 | SCL301 | 000000   | FFFF33   |         
|       |         |
| 12 | Wednesday | 08:00-10:00 | SCL301 | 000000   | FFFF33   |         
|       |         |
+----+-----------+-------------+--------+----------+----------+---------+-------+---------+
3 rows in set (0.00 sec)

Fix:
    I think my query is correct and I don't know what going on about my 
query.

Synopsis:    Problem about ORDER BY
Submitter-Id:    <submitter ID>
Originator:    Charin Nawaritloha
Organization:   Department of Computer Science, Kasetsart University, 
Bangkok Thailand.
MySQL support:  none
Severity:    non-critical
Priority:    medium
Category:    mysql client
Class:        sw-bug
Release:    mysql-3.23.38

Exectutable:   mysqld
Environment:   SUN E250.
System:        Solaris 8.
Compiler:      I use binary to install
Architecture:  ?


---------------------------------------------------------------------
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

Reply via email to