Case statement in Order by section?
Date: Thu, 24 Jul 2008 06:03:59 -0700 (PDT)
I am usint 10g.
I know that you can put a decode in the order by section. But I tried to see if it is possible to put a case statement in the order by section. My little experiment did not work.
Has anyone in this forum successfully put a case statement in the order by section? If so, how did you do it. Below is a sample of what I tried to do.
CREATE OR REPLACE PROCEDURE TestOrderBy
User_Choice IN VARCHAR, TestCur IN OUT Test_OrderBy.TEstCur )IS
Open TestCur For
select object_name, User_Choice
When User_Choice = 'A' Then object_name Else Object_Name desc
END TestOrderBy; Received on Thu Jul 24 2008 - 08:03:59 CDT