Previous Thread
Next Thread
Print Thread
Rate Thread
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?

Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
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/


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)