This link helps to understand the sorting of null values better.
CASE WHEN(rd.riskdistributionflag LIKE 'Y' AND rd.fundingstatustypekey=2)
THEN 'RDU'
WHEN (rd.riskdistributionflag LIKE 'Y' AND rd.fundingstatustypekey=1)
THEN 'RDF'
END AS RDUF,
ORDER BY nvl(RDUF,'AAA')
The above query ensures the NULL rows are ordered first and then the data comes later.
This link helps to understand the sorting order
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment