select decode(e.Recipeflag_Int,
(select count(*) from t_opr_outpatientrecipe a where
a.recorddate_dat between to_date('2017-08-03 00:00:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2017-08-03 23:59:59','yyyy-mm-dd hh24:mi:ss')
and a.recorddate_dat=(select min(recorddate_dat) from t_opr_outpatientrecipe where a.registerid_chr=registerid_chr)=1),1,0)
from t_opr_outpatientrecipe e
這個陳述句,查詢明細中的資訊,找到時間最早的那一個,再跟明細對比如果結果為1,就顯示1,結果不為1,顯示0.
uj5u.com熱心網友回復:
知識整理的內容,在博客中記錄一下吧!
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/86408.html
標籤:非技術區
