标签:
create view total as select s.organization_name,s.name,s.sex,s.identity_card_number,date_format(s.final_into_association_time,‘%Y-%m-%d‘),s.number_of_worked_in_association,(year(now())-year(s.begin_working_time)+s.number_of_worked_in_association) as years,s.duty_name,date_format(s.begin_working_time,‘%Y-%m-%d‘),s.state from staff_incumbency s,organization o where s.organization_name =o.name and duty_name =‘XX‘ and o.code like ‘_____0000‘ and (year(now())-year(s.begin_working_time)+s.number_of_worked_in_association) >=10; create view total2 as select o.code, s.organization_name,s.name,s.sex,s.identity_card_number,s.number_of_worked_in_association,s.state,date_format(s.dimission_time,‘%Y-%m-%d‘),s.dimission_duty_name from staff_dimission s,organization o where s.organization_name =o.name and s.dimission_duty_name =‘XX‘ and o.code like ‘_____0000‘ and s.number_of_worked_in_association >=10 order by o.code;
标签:
原文地址:http://my.oschina.net/anna153/blog/372673