我想要一个Completion_Status列的特定订单,如:
完成,通过,不完整和失败
我该如何订购?我想定义上面的顺序.
我试过CASE,但是它给了我一个错误,就像期待NUM不是CHAR一样.
select DISTINCT
u.first_name || ' ' || u.last_name "Employee_Name",
rco.title "Course_Name",
decode(p.status,'P','Passed', 'F','Failed', 'C','Completed', 'I','Incomplete', 'Not Attempted') "Completion_Status",
to_char(p.completed_date,'YYYY-MM-DD') "Date_Completed"
from
offering o, offering_enrollment oe, users u , performance p, offering_content_object c, content_object rco
where
o.id = oe.offering_id and
u.id = oe.user_id and
o.content_object_id = c.id AND
p.content_object_id = c.source_id and
p.content_object_id = rco.id AND
p.user_id(+) = u.id and
u.id in ( select id
from users
where manager_id = $user.id$)
AND
p.content_object_id NOT IN (41453457, 130020319, …Run Code Online (Sandbox Code Playgroud)