[thelist] Query Question: Order By, Group By, or Sub Query

Casey Crookston caseyc at IntelliSoftmn.com
Wed May 31 11:24:33 CDT 2006


>>If I understand your problem correctly:

select *
from mytable
order by Title asc<<

-------------------

I was not very clear.  The titles could be anything and we can't use
them for the sort:

> ID         Parent ID           Title
>
> ----------------------------------------------
>
> 1                              About
>
> 2          1                   History
>
> 4          1                   Our People
>
> 3                              Contact

What we need to do is first return all rows where there is no parent id
(thus a top level link) BUT under each top level link we need to return
any rows where parented = ID

Hope that makes more sense

Casey 





More information about the thelist mailing list