|
|
@@ -45,23 +45,23 @@ with sa_salestarget as (
|
|
|
m12.target_l as m12l,
|
|
|
m12.target_h as m12h
|
|
|
from sa_salestargethr t1
|
|
|
- left join sa_salestarget y1 on t1.hrid = y1.hrid and y1.type = '年' and y1.point = 1
|
|
|
- left join sa_salestarget s1 on t1.hrid = s1.hrid and s1.type = '季' and s1.point = 1
|
|
|
- left join sa_salestarget s2 on t1.hrid = s2.hrid and s2.type = '季' and s2.point = 2
|
|
|
- left join sa_salestarget s3 on t1.hrid = s3.hrid and s3.type = '季' and s3.point = 3
|
|
|
- left join sa_salestarget s4 on t1.hrid = s4.hrid and s4.type = '季' and s4.point = 4
|
|
|
- left join sa_salestarget m1 on t1.hrid = m1.hrid and m1.type = '月' and m1.point = 1
|
|
|
- left join sa_salestarget m2 on t1.hrid = m2.hrid and m2.type = '月' and m2.point = 2
|
|
|
- left join sa_salestarget m3 on t1.hrid = m3.hrid and m3.type = '月' and m3.point = 3
|
|
|
- left join sa_salestarget m4 on t1.hrid = m4.hrid and m4.type = '月' and m4.point = 4
|
|
|
- left join sa_salestarget m5 on t1.hrid = m5.hrid and m5.type = '月' and m5.point = 5
|
|
|
- left join sa_salestarget m6 on t1.hrid = m6.hrid and m6.type = '月' and m6.point = 6
|
|
|
- left join sa_salestarget m7 on t1.hrid = m7.hrid and m7.type = '月' and m7.point = 7
|
|
|
- left join sa_salestarget m8 on t1.hrid = m8.hrid and m8.type = '月' and m8.point = 8
|
|
|
- left join sa_salestarget m9 on t1.hrid = m9.hrid and m9.type = '月' and m9.point = 9
|
|
|
- left join sa_salestarget m10 on t1.hrid = m10.hrid and m10.type = '月' and m10.point = 10
|
|
|
- left join sa_salestarget m11 on t1.hrid = m11.hrid and m11.type = '月' and m11.point = 11
|
|
|
- left join sa_salestarget m12 on t1.hrid = m12.hrid and m12.type = '月' and m12.point = 12
|
|
|
+ left join sa_salestarget y1 on t1.sa_saleareaid = y1.sa_saleareaid and y1.type = '年' and y1.point = 1
|
|
|
+ left join sa_salestarget s1 on t1.sa_saleareaid = s1.sa_saleareaid and s1.type = '季' and s1.point = 1
|
|
|
+ left join sa_salestarget s2 on t1.sa_saleareaid = s2.sa_saleareaid and s2.type = '季' and s2.point = 2
|
|
|
+ left join sa_salestarget s3 on t1.sa_saleareaid = s3.sa_saleareaid and s3.type = '季' and s3.point = 3
|
|
|
+ left join sa_salestarget s4 on t1.sa_saleareaid = s4.sa_saleareaid and s4.type = '季' and s4.point = 4
|
|
|
+ left join sa_salestarget m1 on t1.sa_saleareaid = m1.sa_saleareaid and m1.type = '月' and m1.point = 1
|
|
|
+ left join sa_salestarget m2 on t1.sa_saleareaid = m2.sa_saleareaid and m2.type = '月' and m2.point = 2
|
|
|
+ left join sa_salestarget m3 on t1.sa_saleareaid = m3.sa_saleareaid and m3.type = '月' and m3.point = 3
|
|
|
+ left join sa_salestarget m4 on t1.sa_saleareaid = m4.sa_saleareaid and m4.type = '月' and m4.point = 4
|
|
|
+ left join sa_salestarget m5 on t1.sa_saleareaid = m5.sa_saleareaid and m5.type = '月' and m5.point = 5
|
|
|
+ left join sa_salestarget m6 on t1.sa_saleareaid = m6.sa_saleareaid and m6.type = '月' and m6.point = 6
|
|
|
+ left join sa_salestarget m7 on t1.sa_saleareaid = m7.sa_saleareaid and m7.type = '月' and m7.point = 7
|
|
|
+ left join sa_salestarget m8 on t1.sa_saleareaid = m8.sa_saleareaid and m8.type = '月' and m8.point = 8
|
|
|
+ left join sa_salestarget m9 on t1.sa_saleareaid = m9.sa_saleareaid and m9.type = '月' and m9.point = 9
|
|
|
+ left join sa_salestarget m10 on t1.sa_saleareaid = m10.sa_saleareaid and m10.type = '月' and m10.point = 10
|
|
|
+ left join sa_salestarget m11 on t1.sa_saleareaid = m11.sa_saleareaid and m11.type = '月' and m11.point = 11
|
|
|
+ left join sa_salestarget m12 on t1.sa_saleareaid = m12.sa_saleareaid and m12.type = '月' and m12.point = 12
|
|
|
where t1.sa_salestargetbillid = $sa_salestargetbillid$
|
|
|
)
|
|
|
select *
|