You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.3 KiB
SQL
64 lines
2.3 KiB
SQL
select vv.* from
|
|
(
|
|
|
|
select
|
|
ltrim(
|
|
rtrim(SUBSTRING(
|
|
substring( 邮件主题,charindex('number',v.邮件主题,1)+6,LEN(v.邮件主题)-charindex('number',v.邮件主题,1)),1
|
|
,LEN(substring( 邮件主题,charindex('number',v.邮件主题,1)+6,LEN(v.邮件主题)-charindex('number',v.邮件主题,1)))-
|
|
LEN(' is now available'))
|
|
)
|
|
) as tdh
|
|
|
|
from
|
|
(select m.邮件id,m.邮件主题,m.邮件发送日期,m.处理时间,DATEDIFF(mi,m.邮件发送日期,m.处理时间)as minYsh
|
|
from t_op_seae_edi_mail m where 邮件主题 like '%origin%'and 邮件发送日期>=cast('2017-11-30' as date) and 邮件发送日期<cast('2017-12-1' as date)
|
|
)v
|
|
)
|
|
vv
|
|
where tdh not in
|
|
(
|
|
|
|
select t.提单号 -- , t.任务类型
|
|
from t_op_task t where t.任务开始时间>=CAST('2017-11-30' as datetime) and 任务开始时间<CAST('2017-12-1' as datetime)
|
|
and t.任务类型='ORIGINAL'
|
|
)
|
|
|
|
|
|
|
|
-------------
|
|
select count(tsk.pl_id) as ncount from
|
|
(select t.pl_id,t.提单号,任务类型 from t_op_task t where t.是否公共=1 and t.任务类型='VC' and t.是否完成=0)tsk join
|
|
(select 主提单号,客服员,操作员,编号 from t_op_seae where 业务类型='普通货' ) s
|
|
on tsk.提单号=s.主提单号 and 客服员='DEMO-SA'
|
|
|
|
|
|
------------
|
|
update t_op_task set 任务相关人员= v.客服员,sea编号=v.编号,是否公共=0 ,备注= isnull(备注,'')+'(重新匹配任务)' from
|
|
(
|
|
---select
|
|
select 任务类型,tsk.pl_id,tsk.提单号,s.客服员,s.编号 from
|
|
(select t.pl_id,t.提单号,任务类型 from t_op_task t where t.是否公共=1 and t.任务类型='VC' and t.是否完成=0)tsk join
|
|
(select 主提单号,客服员,操作员,编号 from t_op_seae where 业务类型='普通货' ) s
|
|
on tsk.提单号=s.主提单号
|
|
--select
|
|
) v where t_op_task.pl_id = v.pl_id
|
|
|
|
|
|
|
|
-----
|
|
select * from t_op_seae_edi_mail m where 邮件发送日期 between CAST('2017-12-05' as DATEtime) and
|
|
CAST ('2017-12-06' as datetime)
|
|
|
|
|
|
select 邮件ID ,COUNT(1) from t_op_seae_edi_mail m where 邮件发送日期 between CAST('2017-12-05' as DATEtime) and
|
|
CAST ('2017-12-06' as datetime) group by 邮件ID having(COUNT(1)>1);
|
|
|
|
select * from t_op_seae_edi_mail where 邮件ID in(
|
|
select 邮件ID from t_op_seae_edi_mail m where 邮件发送日期 between CAST('2017-12-05' as DATEtime) and
|
|
CAST ('2017-12-06' as datetime) group by 邮件ID having(COUNT(1)>1)) order by 邮件id
|
|
|
|
select COUNT(1) as ncount from t_op_task t where t.文件编号='' and t.任务类型='ORIGINAL' AND 是否完成=0
|
|
|
|
select isnull(SEA编号,'') as SEA编号,* from t_op_task t where t.任务类型='ORIGINAL' and t.文件编号='b75e124ee732401e8f1240b7c5286d68'AND 是否完成=0
|
|
|