日期:2014-05-17 浏览次数:20877 次
select * from S_SALE_CHRONICLE
where sts='Y'
and user_id ='40281f81432228ac0143226895cb0008'
and to_date = decode(
(select count(1) from
(SELECT * FROM S_SALE_CHRONICLE
WHERE user_id ='40281f81432228ac0143226895cb0008
'and sts='Y')
where S_SALE_CHRONICLE.to_date = to_date(to_char(sysdate,'yyyy/mm/dd'), 'yyyy/mm/dd')),0,
(select min(to_date)from
(SELECT * FROM S_SALE_CHRONICLE
WHERE user_id ='40281f81432228ac0143226895cb0008'
and sts='Y')
where S_SALE_CHRONICLE.to_date > to_date(to_char(sysdate,'yyyy/mm/dd'), 'yyyy/mm/dd')),
to_date(to_char(sysdate,'yyyy/mm/dd'), 'yyyy/mm/dd') )