Experience in using oracle statement
SELECT
FROM (SELECT A1. , ROWNUM RN
FROM (SELECT H.*
FROM TBC_ADOWNBLK_HIST H
WHERE 1 = 1
ORDER BY adownblkid ASC) A1
WHERE ROWNUM = 1
If you want to sort, you have to write it this way.
-- add a prefix according to different dictionary values
Method one
Select CASE
WHEN dict_code = 'YYPZ' THEN' 0' | | CODE
ELSE'1' | | CODE end as code
Name as name
From MSTB_BDS_DATA
Where (dict_code = 'VOICEOTHERTYPE' or dict_code =' YYPZ')
And record_state ='1'
Method two
(select'0' | | CODE code,NAME from MSTB_BDS_DATA d where d.encoding codewords YYPZ' and record_state ='1') union all (select'1' | | CODE code,NAME from MSTB_BDS_DATA d where d.encoding codewords Voice _ and record_state ='1')