desktop_task_schedule/code/db/常用语句.sql

105 lines
2.3 KiB
SQL

SELECT *
FROM REWARD_GAINERS
FOR UPDATE;
SELECT B.REWARD_NAME,
A.*
FROM REWARD_GAINERS A,
REWARD_PROJECTS B
WHERE A.REWARD_INDEX = B.REWARD_INDEX;
--坐席工号
SELECT DISTINCT S.SALER_CODE,
S.SALER_NAME,
T.TEAM_CODE,
T.TEAM,
BM.DEPARTMENT_CODE,
BM.DEPARTMENT_NAME
FROM TELE_SALER S,
TELE_SALER_TEAM T,
IDST0.BM_T BM
WHERE S.TEAM_CODE = T.TEAM_CODE
AND T.DEPARTMENT_CODE = BM.DEPARTMENT_CODE
AND S.SALER_CODE = '61136';
SELECT *
FROM TELE_SALER_TEAM T
WHERE T.TEAM_CODE = '107077'
SELECT *
FROM
ORDER BY ,
;
SELECT ,
SUM() ,
SUM() ,
ROUND((SUM() / SUM()) * 100,
0) || '%'
FROM
GROUP BY ;
--车非个人每月业绩
SELECT ,
,
,
SUM(),
SUM(),
ROUND(SUM() / SUM() * 100,
2)
FROM
GROUP BY ,
,
HAVING = '10月'
ORDER BY ,
DESC;
SELECT ,
ROUND(SUM() / SUM() * 100,
2)
FROM
WHERE = 'QDI'
AND = '10'
AND = '2023'
GROUP BY
ORDER BY DESC;
--续保率
SELECT ,
ROUND(NVL(SUM() / SUM() * 100,
0),
2)
FROM XB
WHERE XB. = '续保业务部'
GROUP BY
ORDER BY DESC;
-------------------------------------
SELECT ZX.SALER_NAME,
BM.DEPARTMENT_NAME
FROM TELE_SALER ZX,
TELE_SALER_TEAM TEAM,
IDST0.BM_T BM
WHERE ZX.SALER_NAME = '张楚沂'
AND ZX.TEAM_CODE = TEAM.TEAM_CODE
AND TEAM.DEPARTMENT_CODE = BM.DEPARTMENT_CODE;
----------------------------------------
/*
truncate table BI机构渗透率跟踪表;
*/
SELECT *
FROM BI电销坐席车非渗透率跟踪表 T
WHERE T. = '杨苗';
SELECT *
FROM "BI电销坐席续保率跟踪表-24年"
WHERE = '杨苗';
SELECT *
FROM BI机构渗透率跟踪表;
SELECT *
FROM "BI机构续保率跟踪表-24年";