2008年11月17日星期一

UFDIA NC 薪资有用的SQL语句

--公共项目与发放项目对照表
select a.vname,a.iitemid,a.pk_wa_item,b.vname,b.cperiod,c.pk_wa_class,c.vwaclassname
from wa_item a
left join wa_classitem b on a.pk_wa_item = b.pk_wa_item
left join wa_waclass c on c.pk_wa_class = b.pk_wa_class
--where b.cperiod = '10'
--and b.vname like '实发工资'
order by a.iitemid

--导出所有发放项目公式语句
select a.vname,a.iitemid,a.pk_wa_item,b.vname,b.vformulastr,b.vformula,b.cperiod,c.pk_wa_class,c.vwaclassname,c.pk_wa_class
from wa_item a
left join wa_classitem b on a.pk_wa_item = b.pk_wa_item
left join wa_waclass c on c.pk_wa_class = b.pk_wa_class
where b.cperiod = '10' and b.vformulastr is not null --and b.vformulastr <> ''
--and b.vname = '浮动工资' and c.vwaclassname like '%四分公司司乘工资分配表%'
order by a.iitemid

--未被使用公共项目查询语句
select a.vname,a.iitemid,a.pk_wa_item,b.vname,b.cperiod,c.pk_wa_class,c.vwaclassname
from wa_item a
left join wa_classitem b on a.pk_wa_item = b.pk_wa_item
left join wa_waclass c on c.pk_wa_class = b.pk_wa_class
where --b.cperiod = '08'
b.vname is null
order by a.iitemid
--
郎啊郎别太忙 | langalang.blogspot.com

没有评论:

发表评论