|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hello, I hope someone can help me.
I have a column in a select query that is of type TimeStamp and the value is often NULL. I have this column in my ORDER BY clause in the query. The problem is that I need the rows with this TimeStamp=NULL to be listed first, then the other dates. Using DESC and ASC does not change the order of NULL rows and I can't put COALESCE() in the ORDER BY CLAUSE. How can I get this query to order NULL rows first, then valid data after that?
__________________
Beware of a programmer with a screwdriver! |
|
#2
|
|||
|
|||
|
Simple :-)
Read the docs please. Since Firebird 1.5: 1) select * from sometable order by timestampfield nulls first 2) You can have COALESCE in ORDER BY |
|
#3
|
||||
|
||||
|
Quote:
Thankyou - this fixes my problem. The 1.5 release added a number of nice bits that have helped me a lot - Well done firebird ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > ORDER BY with NULL values |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|