查错SQL

来源:互联网 发布:js网页快捷方式到桌面 编辑:程序博客网 时间:2024/05/29 19:20

1.

 select  cgicode ||orderclass ||fcode  from askquotelist where status>='70' and (asktype='01' or asktype='02')        
      and   ( ( rtexcetodate is null and rtexcedate<=TO_DATE('11/01/2010','mm/dd/yyyy') )
      or  ( rtexcedate<=TO_DATE('11/01/2010','mm/dd/yyyy') and TO_DATE('11/01/2010','mm/dd/yyyy')<rtexcetodate) )        
group by cgicode ,orderclass ,fcode
having count(*)>1

 

 

select  count(*),cgicode ,orderclass ,fcode,destccode  from askquotefob  where status>='70'    
and   ( ( rtexcetodate is null and rtexcedate<=TO_DATE('7/01/2010','mm/dd/yyyy') ) or  ( rtexcedate<=TO_DATE('7/01/2010','mm/dd/yyyy') and TO_DATE('7/01/2010','mm/dd/yyyy')<rtexcetodate) )        
group by cgicode ,orderclass ,fcode ,destccode 
having count(*)>1

 

2.

 

select  count(*),cgicode ,orderclass ,destccode  from packingcost where status>='70'    
and   ( ( excetodate is null and excedate<=TO_DATE('7/01/2010','mm/dd/yyyy') ) or  ( excedate<=TO_DATE('7/01/2010','mm/dd/yyyy') and TO_DATE('7/01/2010','mm/dd/yyyy')<excetodate) )        
group by cgicode ,orderclass ,destccode 
having count(*)>1

 

3.

 

select  count(*),cgicode ,orderclass ,destccode,fcode  from fobupricdetail where status>='80'    
and   ( ( excetodate is null and odate<=TO_DATE('7/01/2010','mm/dd/yyyy') )
 or  ( odate<=TO_DATE('7/01/2010','mm/dd/yyyy') and TO_DATE('7/01/2010','mm/dd/yyyy')<excetodate) )        
group by cgicode ,orderclass ,destccode  ,fcode
having count(*)>1

 

 

原创粉丝点击