|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
I have a problem on my server (running MySQL 4.0.6) when sorting on fields that have NULL values... The rows with NULL in the order by field always shows up first both on ASC and DESC. Because of this, the empty rows always shows on the first page on the user list for example, not very user friendly. I just noticed that this is not the case here at td, so I'm figuring it's either to do with the MySQL-version or some configure option.
The MySQL manual is a bit indecisive about the fact, in one place it says that NULL values always shows up first, and in another place it says NULL values are listed at the bottom when sorting on DESC.
Does anyone have any insight on this?
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
I just did a couple of tests using MySQL 3.23.45. With ASC, the NULL values are at the beginning. With DESC, they're at the end.
What's the actual query you're using?
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
It doesn't matter which query I'm using. It happens on all queries where there are null values in the order by field. Try sorting on Homepage or something in the userlist on my site and you'll see what happens: http://forum.rollspel.nu/
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 808
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|