Help - Help on SQL
Posted in 1995
I got a couple of replies for my question below which had asked
me to do a DESC order. I am sorry I did'nt write my question
properly. I want the resultant set to be ordered ASC but the null
values ( should in some way assume the highest value ) should
appear at the bottom.
If you take a look at the resultant set. It is in ASC order the
only difference being that the NULL values have taken on the
highest values and appears at the bottom.
Sorry for being vague when I asked my question.Thanks for the
responses.
Thanks,
Kalyan.
______________________________ Forward Header __________________________________
Subject: Help on SQL
Author: T. Kalyan at North-Supply
Date: 12/18/95 2:34 PM
The result set we get for ...
SELECT col1, col2, col3 FROM tbl1 ORDER BY col1, col2, col3
... is as shown below :
col1 col2 col3
^^^^ ^^^^ ^^^^
Null Null A
Null Null B
Null A A
Null A B
Null B A
A A A
A A B
A B A
Is it possible to write a SQL so that the NULL values are pushed
to the bottom and the ordering remains the same.
The resultant set should be as shown below.
col1 col2 col3
^^^^ ^^^^ ^^^^
A A A
A A B
A B A
Null A A
Null A B
Null B A
Null Null A
Null Null B
Thanks,
Kalyan.