select a.*,b.*
from a inner join b on a.contract_number(varchar)=b.cnotract_number
where start_date(datetime)> 2000.01.01 and  start_date(datetime)<2003.06.04 
and kaoping_result=1

解决方案 »

  1.   

    select count(*) as c, person_code from a aa, (select * from b where start_date >2000.01.01 and start_date<2003.06.04) bb where aa.kaoping_result = 1 
    group by person_code
      

  2.   

    select a.*
    from a a,b b 
    where b.start_date>'2004.01.01' and b.start_date<'2003.06.04'
    and kaoping_result=1
      

  3.   

    select count(*) as c, person_code from a aa, (select * from b where start_date >2000.01.01 and start_date<2003.06.04) bb where aa.kaoping_result = 1 and aa.cnotract_number=bb.cnotract_number
    group by person_code
      

  4.   

    select person_code,count(*) as kaopingCount from a 
    left join b on a.cnotract_number=b.cnotract_number 
    where b.start_date between '2000.01.01' and '2003.06.04' 
    and a.kaoping_result = 1 
    group by person_code
      

  5.   

    select person_code,  count(*) as keyCfrom a , (select * from b where start_date >2000.01.01 and start_date<2003.06.04) b where a.kaoping_result = 1 and a.cnotract_number=b.cnotract_number
    group by person_code
      

  6.   


    select person_code,count(kaoping_result) from 表A left outer join 表B on 表A.contract_number = B.contract_number where start_date between 2000.01.01 and 2003.06.04
      

  7.   

    select a.contract_number contract_number, a.kaoping_result kaoping_result,a.person_code person_code,
    b.start_date start_date
    from a, b 
    where kaoping_result = 1
    and
    a.contract_number = b.contract_number
    and 
    b.start_date > '2000.01.01'
    and
    b.start_date < '2003.06.04'
      

  8.   

    select person_code,count(*) as kaopingCount from a 
    left join b on a.cnotract_number=b.cnotract_number 
    where b.start_date between '2000.01.01' and '2003.06.04' 
    and a.kaoping_result = 1 
    group by person_code