34,593
社区成员
发帖
与我相关
我的任务
分享
--1
select t1.sl_qm , t2.sl_qm , t3.dj_min from
(
select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1 Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%' ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp
) t1 left join
(
select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%' ORDER BY bm_gsjg,bm_ck,bm_sp
) t2 on t1.bm_gsjg = t2.bm_gsjg and t1.bm_ck = t2.bm_ck and t1.bm_sp = t2.bm_sp and t1.mc = t2.mc left join
(
SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0
) t3 on t2.bm_sp = t3.bm_sp
--2
select t1.sl_qm , t2.sl_qm , t3.dj_min from
(
select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1 Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%' ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp
) t1 inner join
(
select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%' ORDER BY bm_gsjg,bm_ck,bm_sp
) t2 on t1.bm_sp = t2.bm_sp inner join
(
SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0
) t3 on t2.bm_sp = t3.bm_sp
--3
select t1.sl_qm , t2.sl_qm , t3.dj_min from
(
select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1 Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%' ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp
) t1 ,
(
select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%' ORDER BY bm_gsjg,bm_ck,bm_sp
) t2 ,
(
SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0
) t3
--掉了个b
select
a.sl_qm,b.sl_qm,c.dj_min
from
(select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1 Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%')a
left join
(select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%')b
on
a.bm_gsjg=b.bm_gsjg,a.bm_ck=b.bm_ck,a.bm_sp=b.bm_sp,a.mc=b.mc
left join
(SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0)c
on
a.bm_sp=c.bm_sp
order by
a.bm_gsjg,a.bm_ck,a.bm_sp
select
a.sl_qm,b.sl_qm,c.dj_min
from
(select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1
Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%')a
left join
(select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc
Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%')b
on
a.bm_gsjg=b.bm_gsjg and a.bm_ck=b.bm_ck and a.bm_sp=b.bm_sp and a.mc=b.mc
left join
(SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp
WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0)c
on
a.bm_sp=c.bm_sp
order by
a.bm_gsjg,a.bm_ck,a.bm_sp
select
a.sl_qm,b.sl_qm,c.dj_min
from
(select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1 Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%')a
left join
(select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%')b
on
a.bm_gsjg=b.bm_gsjg,a.bm_ck=b.bm_ck,a.bm_sp=b.bm_sp,a.mc=.mc
left join
(SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0)c
on
a.bm_sp=c.bm_sp
order by
a.bm_gsjg,a.bm_ck,a.bm_sp
select
a.sl_qm,b.sl_qm,c.dj_min
from
(select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm from v_zb_kc_draft a left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1 Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%')a
left join
(select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm from v_zb_kc Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%')b
on
a.bm_gsjg=b.bm_gsjg,a.bm_ck=b.bm_ck,a.bm_sp=b.bm_sp,a.mc=.mc
left join
(SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0)c
on
a.bm_sp=c.bm_sp
order by
a.bm_gsjg,a.bm_ck,a.bm_sp
select A.sl_qm ,B.sl_qm ,C.dj_min
(
select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm
from v_zb_kc_draft a
left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1
Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%'
--ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp
) A
left join
(
select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm
from v_zb_kc
Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%'
--ORDER BY bm_gsjg,bm_ck,bm_sp
) B on A.bm_gsjg=bm_gsjg. and A.bm_ck=B.bm_ck and A.bm_sp=B.bm_sp and A.mc=B.mc
left join
(
SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp
WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0
) C on A.bm_sp=C.bm_sp
ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp
select A.sl_qm ,B.sl_qm ,C.dj_min
(
select a.bm_gsjg, a.bm_ck, a.bm_sp, a.mc, a.dj_ls,a.sl_qm
from v_zb_kc_draft a
left join t_bm_splimit b on a.bm_gsjg = b.bm_gsjg and a.bm_ck = b.bm_ck and a.bm_sp = b.bm_sp and is_kc = 1
Where 1 = 1 And isnull(a.bm_gsjg,'') like 'CYZ' and sl_qm > 0 and a.bm_sp like 'DPZBZD001%'
--ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp
) A
left join
(
select bm_gsjg, bm_ck, bm_sp, mc, dj_ls, sl_qm
from v_zb_kc
Where is_kc = 1 And isnull(bm_gsjg,'') like 'CYZ' And isnull(bm_sp,'') like 'DPZBZD001%'
--ORDER BY bm_gsjg,bm_ck,bm_sp
) B on A.bm_gsjg=bm_gsjg. and A.bm_ck=B.bm_ck and A.bm_sp=B.bm_sp and A.mc=B.mc
(
SELECT t_bm_spdj.bm_sp, t_bm_spdj.dj_ls, t_bm_sp.dj_min FROM t_bm_spdj, t_bm_sp
WHERE t_bm_spdj.bm_sp = t_bm_sp.bm and ( t_bm_spdj.bm_sp = 'DPZBZD001' ) and bm_gsjg = '' and bm_ck = '' and bzgg = 0
) C on A.bm_sp=C.bm_sp
ORDER BY a.bm_gsjg,a.bm_ck,a.bm_sp