johnirl has asked for the wisdom of the Perl Monks concerning the following question:
The values are ordered correctly (as above) in my database but when I retrieve them using a rather complicted SQL statement they become sorted ie 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4.......
Another problem I have is that all the Zero values are stored as null in the database. After my SQL statement is run it sends all the nulls to the end of the file. Unfortunatly not all the nulls are Zeros. Some are in fact nulls.
I'm comparing two tables using an outer join so some of the nulls would be non comparable results ie a result from table one that can't be matched to the second table.
memory . memory . . . . . . . . . . . . . 256 78879 256 8706 [Full result ordered 256 80700 256 7898 incorrectly (most common)] 256 53454 256 2345 -- 76896 -- 7860 [Result for 2 -- 76967 -- 8087 zero values] -- 34456 -- 2344 -- -- 2 7697 [No comparable values] -- -- 2 7696 -- -- 2 7687 -- -- 2 7869 -- -- 4 6797 2 6798 -- -- 2 7008 -- -- . . . . . . . . . . . .
So what I am hoping to do is
1) Order the results in the desired way.
2) Seperate nulls from zeros.
Any ideas are appreciated. I realise that this is a complex issue but even bit answers and suggestions are helpful.
Thanks Guys.
j o h n i r l .
Sum day soon I'Il lern how 2 spelI (nad tYpe)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Considerations on ordering
by cebrown (Pilgrim) on Aug 13, 2002 at 12:49 UTC | |
by johnirl (Monk) on Aug 13, 2002 at 12:58 UTC | |
by cebrown (Pilgrim) on Aug 13, 2002 at 13:21 UTC | |
by johnirl (Monk) on Aug 13, 2002 at 13:35 UTC | |
by cebrown (Pilgrim) on Aug 13, 2002 at 15:31 UTC | |
| |
|
Re: Sorting
by Anonymous Monk on Aug 13, 2002 at 13:00 UTC |