November 12th, 2000, 03:53 PM
-
i'm trying to get
apple
banana
orange
NULL
NULL
NULL
instead of
NULL
NULL
NULL
apple
banana
orange
-- possible?
[This message has been edited by RyanP (edited November 12, 2000).]
November 12th, 2000, 09:03 PM
-
null will always be first/last (depending on sort order).
The only way I can think of is to use something like:
select foo,bar,etc,if(isnull(fruit),'zzzzz',fruit) as fruits from table order by fruits;
Then you'll have to check for 'zzzzz' and replace it.
Not elegent but will work, unless your field would ever have a bunch of z's at start normally.
[This message has been edited by rod k (edited November 12, 2000).]
November 12th, 2000, 09:17 PM
-
hehe, not elegant indeed, but a nice work around, thanks for the idea, i'll let you know if i run into anything better
November 13th, 2000, 06:47 AM
-
SELECT *
FROM tblFruit
WHERE fruit IS NOT NULL
ORDER BY fruit;
That should do it if there are NULL values in fruit otherwise if fruit contains an empty string:
SELECT *
FROM tblFruit
WHERE fruit = ""
ORDER BY fruit;
Andy J
November 13th, 2000, 07:50 AM
-
Read the ? again, Andy. He still wants the records with null values.