Sorting: go to first none-null value when ascending

Sorting: go to first none-null value when ascending

jeryslojeryslo Posts: 4Questions: 0Answers: 0
edited April 2011 in General
Hello there!

I have a database with lots of rows (140 000) of weather data, where each row is 5 minutes interval. Now because of need of correct graphs, I need to have null values, if the data is missing. Currently there is aproximately 2000 rows where all except the PK column (Date) have null values. The problem is, when using DataTables and then sorting it on for example Temperature. If it is set to descending, there is no problem, it's starts with the highest measured temperature, but if it is set to ascending, it will first list all of the null values for temperature, and then will the lowest none-null data appear. As I said, the problem is, because there is lots of null values, so the user has to go through alot of pages to reach first actual data (none null value). Now my idea is, that I should somehow change the sorter, when displaying descending/ascending data, it should automatically go to that page, where the first data appears.

Now under plugin, there are some sorting functions, but none of them solves my problem.

Now there is the other solution, where I simply delete all the rows, where all the data is null. But as I said, that is the least favourite option, that is why I am asking if somebody has ever come to the same problem.
This discussion has been closed.