SELECT sum(convert_worktime)
FROM tt_tcas_depot_schedule_trans t
where t.dept_code = '020A'
------------分点部考勤查询----------------------------
1.select t.*, rowid from TT_TCAS_DEPOTPBS_EMP_INFO t-----后台计算的表格
2. select t.*, rowid from TT_TCAS_DEPOT_SCHEDULE t; ------------前台显示的表格
select * from TT_TCAS_DEPOT_SCHEDULE t where t.DEPT_CODE = '020A' and t.Emp_Code = '066645'
201501月的数据-----------
select * from TT_TCAS_DEPOT_SCHEDULE t where t.DEPT_CODE = '020A' and commission_MONTH = trunc(sysdate-60, 'mm')
---------------删除数据 log存档地址------------------------------------------------
select t.*, rowid from tl_tcas_oper_log t where OPER_EMP_CODE = '212113'
-------------------
select * from TT_TCAS_HUBPBS_HUB_EMP_INFO
--------------------------------------
1.select t.*, rowid from TT_TCAS_DEPOTPBS_EMP_INFO t-----后台计算的表格
select 字段1,字段2,count(*) from 表名 group by 字段1,字段2 having count(*) > 1
---查询TT_TCAS_DEPOTPBS_EMP_INFO重复的字段-------------------
select Emp_no, Emp_name, count(*)
from TT_TCAS_DEPOTPBS_EMP_INFO
group by emp_no, emp_name
having count(*) > 1
delete from TT_TCAS_DEPOTPBS_EMP_INFO
where EMP_NO, EMP_NAME in (select Emp_no, Emp_name, count(*)
from TT_TCAS_DEPOTPBS_EMP_INFO
group by emp_no, emp_name
having count(*) > 1)
select distinct * from TT_TCAS_DEPOTPBS_EMP_INFO where area_code like '020%'
CREATE TABLE ABC AS ( select distinct * from TT_TCAS_DEPOTPBS_EMP_INFO where area_code like '020%')
select * from ABC
drop table ABC
-----------------------中转场60000数据准备-自动插入-------------------
begin
for i in 811100000..811160002 loop
insert into TT_TCAS_HUBPBS_HUB_EMP_INFO
(
HUB_PBS_EMP_ID,
EMP_NO,
WORK_TIME,
JOB_SEQ,
GROUP_CODE,
WORK_DATE,
DEPT_CODE,
AREA_CODE,
EMP_NAME,
PERSON_TYPE,
CREATED_EMP_CODE,
CREATED_TM,
MODIFIED_EMP_CODE,
MODIFIED_TM,
JOB_SEQ_CODE,
PERSON_TYPE_CODE )
values(i,
to_char(i),
'8',
'0.5',
'group_name_' || i,
date'2021-01-01',
'755W',
'755Y',
i,
'全日制员工',
'212113',sysdate,
'212113',sysdate,
'z' || i,
'A'
);
end loop;
commit;
end;
注意字体和字符串的一致正确