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

67 lines
1.4 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 = '06月'
ORDER BY ,
DESC;
SELECT ,
round(SUM() / SUM() * 100,
2)
FROM
WHERE = 'QDI'
AND = '06月'
GROUP BY
ORDER BY DESC;