有指定的值就取指定的值,若沒有就取最小值

select g.mnr from g_nr g where g.info_id = '1ecde282-384f-4bb3-8b9c-c78906965c2a'
   and g.nrtype = (select DISTINCT (case when (select nrtype from g_nr where info_id = g.info_id and nrtype = 3 and rownum = 1) = 3 then 3
                                     else (select min(nrtype) from g_nr where info_id = g.info_id) end) nrtype from g_nr where info_id = g.info_id)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章