Re: Order By question



"MP" <nospam@xxxxxxxxxx>'s wild thoughts were released on
Tue, 31 Oct 2006 14:46:34 -0600 bearing the following fruit:

vb6, ado, .mdb format, no access, win2k
sql newb <g>
assuming sql such as "Select F1, F2 From TableName Order by...."

with this order by statement
"order by F1, F2 DESC "

I don't really understand, you seem to want to order some of
the data one way and other data another.

J

the records are returned thus
F1 : F2

1N : 36
1N : 24
1N : 12

2L : 36
2L : 24
2L : 12

3R : 36
3R : 24
3R : 12

4B : 36
4B : 24
4B : 12


How can i change 'order by' statement (or create self-join) to return thus

1N : 36<<<< orig order ok
1N : 24
1N : 12

<<<<<<<<<<<< here need to group by F1 first, then Order by F2 somehow
2L : 36
3R : 36

2L : 24
3R : 24

2L : 12
3R : 12
<<<<<<<<<<<<

4B : 36<<<< orig order ok
4B : 24
4B : 12

Thanks for any pointers
Mark



Jan Hyde (VB MVP)

--
The crooked Santa who broke out of jail might be called "an escape Claus." (Renee from Napa)

.