[thelist] SQL Order By Clause

David Shadovitz david_shadovitz at xontech.com
Thu Jul 26 16:14:23 CDT 2001


Just commenting on Rudy's  suggestion:

    select ItemNo, Seq, '        ' from myTable
    where Seq is NOT null
    union all
    select ItemNo, Seq, '**oops**' from myTable
    where Seq IS null
   order by 1

I do this as:

   select ItemNo, IIF(IsNull(Seq),'**oops**',Seq) from myTable
   order by ItemNo

That's in MS Access.  In Oracle, use the NVL function.

-David





More information about the thelist mailing list