由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 菜鸟双黄包求优化
相关主题
一个关于T-SQL的问题Questions on SQL
请问sql server里面怎么输出变量到文本文件?Urgent help needed, please
再请教大牛一个问题help need
pass parameter from stored procedure to SSIS怎样在T-SQl中执行一条放在varchar中的命令
转换成时间的格式 MS SQLAccess Oracle LONG data type using ADO
SQL Server - convert datetime to a string YY-MM-DD HHQuestion about T-SQL
有大侠知道怎么format下面这个query的时间么多对多relation?
convert datetime to ''SQL help.
相关话题的讨论汇总
话题: varchar话题: rept话题: appt话题: convert话题: 15
进入Database版参与讨论
1 (共1页)
h*****p
发帖数: 1516
1
一定双黄包奉上,多谢!
(@P1 varchar(30),@P2 varchar(15),@P3 varchar(15),@P4 varchar(15),@P5 varchar
(15),@P6 varchar(15),@P7 varchar(15),@P8 varchar(15),@P9 varchar(15),@P10
varchar(15),@P11 varchar(15),@P12 varchar(15),@P13 varchar(15),@P14 varchar(
15),@P15 varchar(15),@P16 varchar(15),@P17 varchar(15),@P18 varchar(15),@P19
varchar(15),@P20 varchar(15),@P21 varchar(15),@P22 varchar(15),@P23 varchar
(15),@P24 varchar(15),@P25 varchar(15),@P26 varchar(15),@P27 varchar(15),@
P28 varchar(15),@P29 varchar(15),@P30 varchar(15),@P31 varchar(15),@P32
varchar(15),@P33 varchar(15),@P34 varchar(15),@P35 varchar(15),@P36 varchar(
15),@P37 varchar(15),@P38 varchar(15),@P39 varchar(15),@P40 varchar(15),@P41
varchar(15),@P42 varchar(15),@P43 varchar(15),@P44 varchar(15),@P45 varchar
(15),@P46 varchar(15),@P47 varchar(15),@P48 varchar(15),@P49 varchar(15),@
P50 varchar(15),@P51 varchar(15))SELECT T1.CONFLICT_ID, CONVERT
(VARCHAR (10),T1.DB_LAST_UPD, 101) + ' ' + CONVERT (VARCHAR (10),T1.DB_LAST_
UPD, 8), CONVERT (VARCHAR (10),T1.LAST_UPD, 101) + ' ' + CONVERT (
VARCHAR (10),T1.LAST_UPD, 8), CONVERT (VARCHAR (10),T1.CREATED, 101) +
' ' + CONVERT (VARCHAR (10),T1.CREATED, 8), T1.LAST_UPD_BY, T1.
CREATED_BY, T1.MODIFICATION_NUM, T1.ROW_ID, T7.BASE_CURCY_
CD, T1.TARGET_OU_ID, T7.LOC, T7.NAME, T1.SRA_SR_ID,
T1.ACTIVITY_UID, T1.AGREEMENT_ID, T1.ALARM_FLAG, T1.
BILLABLE_FLG, T1.COST_CURCY_CD, T1.NAME, T1.CAL_TYPE_CD,
CONVERT (VARCHAR (10),T1.APPT_START_DT, 101) + ' ' + CONVERT (VARCHAR (
10),T1.APPT_START_DT, 8), T8.FORMAT_TYPE_CD, CONVERT (VARCHAR (
10),T1.TODO_AFTER_DT, 101) + ' ' + CONVERT (VARCHAR (10),T1.TODO_AFTER_DT, 8
), T6.NAME, T6.CURCY_CD, T1.OPTY_ID, T1.APPT_REPT_
APPT_ID, T2.SRV_REGN_ID, CONVERT (VARCHAR (10),T1.TODO_PLAN_
START_DT, 101) + ' ' + CONVERT (VARCHAR (10),T1.TODO_PLAN_START_DT, 8),
CONVERT (VARCHAR (10),T1.TODO_PLAN_END_DT, 101) + ' ' + CONVERT (VARCHAR (
10),T1.TODO_PLAN_END_DT, 8), T1.PREV_ACT_ID, T1.PR_ATT_ID,
T3.FST_NAME, T1.TARGET_PER_ID, T3.LAST_NAME, T1.PR_ORDER_
ID, T1.OWNER_LOGIN, T1.OWNER_PER_ID, T1.PR_SYMPTOM_CD,
T5.BL_CLASS_CD, T5.BL_CURCY_CD, T1.PROJ_ID, CONVERT (
VARCHAR (10),T4.ACTL_END_DT, 101) + ' ' + CONVERT (VARCHAR (10),T4.ACTL_END_
DT, 8), CONVERT (VARCHAR (10),T4.ACTL_START_DT, 101) + ' ' + CONVERT (
VARCHAR (10),T4.ACTL_START_DT, 8), CONVERT (VARCHAR (10),T4.PLAN_END_
DT, 101) + ' ' + CONVERT (VARCHAR (10),T4.PLAN_END_DT, 8), CONVERT (
VARCHAR (10),T4.PLAN_START_DT, 101) + ' ' + CONVERT (VARCHAR (10),T4.PLAN_
START_DT, 8), T5.NAME, T5.PROJ_NUM, T1.APPT_REPT_FLG,
CONVERT (VARCHAR (10),T1.APPT_REPT_END_DT, 101) + ' ' + CONVERT (VARCHAR (
10),T1.APPT_REPT_END_DT, 8), T9.OWN_INST_ID, T9.INTEGRATION_ID,
T1.TARGET_OU_ADDR_ID, T1.EVT_STAT_CD, T1.CAL_DISP_FLG,
T1.TEMPLATE_FLG, T12.LOGIN, T10.ROW_STATUS, T14.WORK_PH
_NUM, T8.ROW_ID, T8.PAR_ROW_ID, T8.MODIFICATION_NUM,
T8.CREATED_BY, T8.LAST_UPD_BY, CONVERT (VARCHAR (10),T8.CREATED
, 101) + ' ' + CONVERT (VARCHAR (10),T8.CREATED, 8), CONVERT (VARCHAR
(10),T8.LAST_UPD, 101) + ' ' + CONVERT (VARCHAR (10),T8.LAST_UPD, 8),
T8.CONFLICT_ID, T8.PAR_ROW_ID, T9.ROW_ID, T9.PAR_ROW_ID,
T9.MODIFICATION_NUM, T9.CREATED_BY, T9.LAST_UPD_BY,
CONVERT (VARCHAR (10),T9.CREATED, 101) + ' ' + CONVERT (VARCHAR (10),T9.
CREATED, 8), CONVERT (VARCHAR (10),T9.LAST_UPD, 101) + ' ' + CONVERT (
VARCHAR (10),T9.LAST_UPD, 8), T9.CONFLICT_ID, T9.PAR_ROW_ID,
T10.ROW_ID, T11.ROW_ID, T13.ROW_ID FROM dbo.S_EVT_
ACT T1 LEFT OUTER JOIN dbo.S_EMP_PER T2 ON T1.OWNER_PER_ID = T2.
PAR_ROW_ID LEFT OUTER JOIN dbo.S_CONTACT T3 ON T1.TARGET_PER_ID =
T3.PAR_ROW_ID LEFT OUTER JOIN dbo.S_PROJITEM T4 ON T1.PROJ_ITEM_ID
= T4.ROW_ID LEFT OUTER JOIN dbo.S_PROJ T5 ON T1.PROJ_ID = T5.ROW_
ID LEFT OUTER JOIN dbo.S_OPTY T6 ON T1.OPTY_ID = T6.ROW_ID
LEFT OUTER JOIN dbo.S_ORG_EXT T7 ON T1.TARGET_OU_ID = T7.PAR_ROW_ID
LEFT OUTER JOIN dbo.S_EVT_MAIL T8 ON T1.ROW_ID = T8.PAR_ROW_ID
LEFT OUTER JOIN dbo.S_EVT_ACT_SS T9 ON T1.ROW_ID = T9.PAR_ROW_ID
LEFT OUTER JOIN dbo.S_ACT_EMP T10 ON T1.OWNER_PER_ID = T10.EMP_ID AND T1.
ROW_ID = T10.ACTIVITY_ID LEFT OUTER JOIN dbo.S_PARTY T11 ON T10.
EMP_ID = T11.ROW_ID LEFT OUTER JOIN dbo.S_USER T12 ON T10.EMP_ID =
T12.PAR_ROW_ID LEFT OUTER JOIN dbo.S_PARTY T13 ON T1.TARGET_PER_
ID = T13.ROW_ID LEFT OUTER JOIN dbo.S_CONTACT T14 ON T1.TARGET_PER
_ID = T14.PAR_ROW_ID WHERE (T1.TEMPLATE_FLG != 'Y' AND T1.TEMPLATE
_FLG != 'P' OR T1.TEMPLATE_FLG IS NULL) AND (T1.APPT_REPT_REPL_CD = @
P1 AND T1.APPT_REPT_APPT_ID = @P2 OR T1.APPT_REPT_APPT_ID = @P3 OR T1.APPT_
REPT_APPT_ID = @P4 OR T1.APPT_REPT_APPT_ID = @P5 OR T1.APPT_REPT_APPT_ID = @
P6 OR T1.APPT_REPT_APPT_ID = @P7 OR T1.APPT_REPT_APPT_ID = @P8 OR T1.APPT_
REPT_APPT_ID = @P9 OR T1.APPT_REPT_APPT_ID = @P10 OR T1.APPT_REPT_APPT_ID =
@P11 OR T1.APPT_REPT_APPT_ID = @P12 OR T1.APPT_REPT_APPT_ID = @P13 OR T1.
APPT_REPT_APPT_ID = @P14 OR T1.APPT_REPT_APPT_ID = @P15 OR T1.APPT_REPT_APPT
_ID = @P16 OR T1.APPT_REPT_APPT_ID = @P17 OR T1.APPT_REPT_APPT_ID = @P18 OR
T1.APPT_REPT_APPT_ID = @P19 OR T1.APPT_REPT_APPT_ID = @P20 OR T1.APPT_REPT_
APPT_ID = @P21 OR T1.APPT_REPT_APPT_ID = @P22 OR T1.APPT_REPT_APPT_ID = @P23
OR T1.APPT_REPT_APPT_ID = @P24 OR T1.APPT_REPT_APPT_ID = @P25 OR T1.APPT_
REPT_APPT_ID = @P26 OR T1.APPT_REPT_APPT_ID = @P27 OR T1.APPT_REPT_APPT_ID =
@P28 OR T1.APPT_REPT_APPT_ID = @P29 OR T1.APPT_REPT_APPT_ID = @P30 OR T1.
APPT_REPT_APPT_ID = @P31 OR T1.APPT_REPT_APPT_ID = @P32 OR T1.APPT_REPT_APPT
_ID = @P33 OR T1.APPT_REPT_APPT_ID = @P34 OR T1.APPT_REPT_APPT_ID = @P35 OR
T1.APPT_REPT_APPT_ID = @P36 OR T1.APPT_REPT_APPT_ID = @P37 OR T1.APPT_REPT_
APPT_ID = @P38 OR T1.APPT_REPT_APPT_ID = @P39 OR T1.APPT_REPT_APPT_ID = @P40
OR T1.APPT_REPT_APPT_ID = @P41 OR T1.APPT_REPT_APPT_ID = @P42 OR T1.APPT_
REPT_APPT_ID = @P43 OR T1.APPT_REPT_APPT_ID = @P44 OR T1.APPT_REPT_APPT_ID =
@P45 OR T1.APPT_REPT_APPT_ID = @P46 OR T1.APPT_REPT_APPT_ID = @P47 OR T1.
APPT_REPT_APPT_ID = @P48 OR T1.APPT_REPT_APPT_ID = @P49 OR T1.APPT_REPT_APPT
_ID = @P50 OR T1.APPT_REPT_APPT_ID = @P51) OPTION (FAST 40)
c*****d
发帖数: 6045
2
看见优化,看见包子,我就进来了
结果满屏的@,眼都花了
能贴个格式化后的图片附件吗?
好像就是几个left join加T1的条件
y*****g
发帖数: 677
3
有点意思,板凳先观看一会儿
dbo 就是SQL SERVER 的干活
1 (共1页)
进入Database版参与讨论
相关主题
SQL help.转换成时间的格式 MS SQL
help! A bug about date type !SQL Server - convert datetime to a string YY-MM-DD HH
Memo Field一问有大侠知道怎么format下面这个query的时间么
Urgent - Create Table with VARCHAR types in Sybase through JDBCconvert datetime to ''
一个关于T-SQL的问题Questions on SQL
请问sql server里面怎么输出变量到文本文件?Urgent help needed, please
再请教大牛一个问题help need
pass parameter from stored procedure to SSIS怎样在T-SQl中执行一条放在varchar中的命令
相关话题的讨论汇总
话题: varchar话题: rept话题: appt话题: convert话题: 15