select decode(sign(count(1)-3),1,'>3','<3') from tbname where to_char(datecol,'d')>5 and datecol between
to_date('20031101','yyyymmdd') and to_date('20031110','yyyymmdd');

解决方案 »

  1.   

    200311 是带入的参数:select 
    decode(to_date('200311'||'10','YYYYMMDD'),'1','双休日','7','双休日','非双休日'),
    decode(to_date('200311'||'10','YYYYMMDD'),'4','<3','5','<3','6','<3','>=3')
    from dual
      

  2.   

    上贴错了
    200311 是带入的参数:select decode(to_char(to_date('200311'||'10','YYYYMMDD'),'d'),'1','双休日','7','双休日','非双休日'),decode(to_char(to_date('200311'||'10','YYYYMMDD'),'d'),'4','<3','5','<3','6','<3','>=3')
    from dual