I am using the following query written by other developers:
SELECT DISTINCT c.id category_id,
c.parent_id,
d.name AS category_name,
level
FROM category c,
category_language d
WHERE c.id = d.category_id
AND c.is_active = 1
AND c.is_deleted = 0
AND c.deleted_date IS NULL
AND d.is_active = 1
AND d.is_deleted = 0
AND d.deleted_date IS NULL
AND ((to_date(d.expiry_date,'DD-MON-YYYY') > to_date(sysdate,'DD-MON-YYYY'))
OR d.expiry_date IS NULL)
AND d.language_id = 1
AND c.cat_type_id = 1
START WITH c.parent_id =1308206844
CONNECT BY c.parent_id = prior c.id
ORDER SIBLINGS BY d.name
I had two problems.
First, I don't know how START WITH, CONNECT BY, PRIOR Keywords are working in query.
Second, when I change ORDER SIBLINGS BY d.name to ORDER SIBLINGS BY c.priority desc following error message is thrown:=
ORA-01791: not a SELECTed expression
01791. 00000 - "not a SELECTed expression"
I had also tried to change the Datatype of priority from number to string but same error is thrown.
I want to run query of order by c.priority desc for producing desired results.