update 标协会员的视图 复制到 统计视图(新).sql
This commit is contained in:
+23
-1
@@ -2109,4 +2109,26 @@ from (
|
||||
) pp
|
||||
where pp.allMoney is not null
|
||||
and pp.allMoney != 0
|
||||
order by pp.createTime;
|
||||
order by pp.createTime;
|
||||
|
||||
-- 20240705 标协会员的视图创建
|
||||
drop view if exists v_member_project_subitem;
|
||||
CREATE VIEW v_member_project_subitem AS
|
||||
select t1.id,
|
||||
t1.member_no AS member_no,
|
||||
t1.company_id AS company_id,
|
||||
t1.company_name AS company_name,
|
||||
t1.liaison_man_id AS liaison_man_id,
|
||||
t1.member_status AS member_status,
|
||||
t1.effective_date AS effective_date,
|
||||
t1.invalidation_date AS invalidation_date,
|
||||
t1.create_time AS create_time,
|
||||
t1.project_id AS project_id
|
||||
from tb_member_project_subitem t1
|
||||
join
|
||||
(select tb_member_project_subitem.company_id AS company_id,
|
||||
max(tb_member_project_subitem.create_time) AS max_create_time
|
||||
from tb_member_project_subitem
|
||||
group by tb_member_project_subitem.company_id) t2 on t1.company_id = t2.company_id
|
||||
and t1.create_time = t2.max_create_time
|
||||
where t1.member_status is not null;
|
||||
Reference in New Issue
Block a user