Hallo zusammen,
ich habe zwei Tabellen in der ich mir ein count ausgeben lasse.
Leider kommt in dem count(substr... alle weiteren zeichen in der verarbeitung weiter. ich will aber nur die Zeichen 5, 8 als COUNT haben.
teil1 CO 2
teil2 JB 11
teil2 JB 1
teil3 JB 41
teil3 JB 2
teil4 YB 1
teil5 JB 47
teil5 JB 29
teil6 PB 1
so sieht es mit 5,15 aus
teil1 CO 2-L UP 2
teil2 JB 2-L UP 11
teil2 JB 2-R UP 1
teil3 JB 2-L UP 41
teil3 JB 2-R UP 2
teil4 YB 2-L UP 1
teil5 JB 2-L 47
teil5 JB 2-R 29
teil6 PB 2-L 1
teil2 JB müsste also 12 als count haben...
und
teil3 JB 43, hat es aber nicht.
Kann man das ändern?
ich habe zwei Tabellen in der ich mir ein count ausgeben lasse.
PHP-Code:
select
substr(berlin.bppph03.bh3cd1,5,7) Beschreibung,
count (substr(berlin.bppph03.bh3cd1,5,7)) Menge
from berlin.PCPP003
LEFT JOIN berlin.bppph03
ON berlin.pcpp003.PCCAR3 = berlin.bppph03.bh3cod
where
bh3cod=PCCAR3
and
bh3cst=PCSET3
and
PCEDTE = '140916'
and PCCAR3 = 'J'
group by
berlin.bppph03.bh3cd1
order by berlin.bppph03.bh3cd1
teil1 CO 2
teil2 JB 11
teil2 JB 1
teil3 JB 41
teil3 JB 2
teil4 YB 1
teil5 JB 47
teil5 JB 29
teil6 PB 1
so sieht es mit 5,15 aus
teil1 CO 2-L UP 2
teil2 JB 2-L UP 11
teil2 JB 2-R UP 1
teil3 JB 2-L UP 41
teil3 JB 2-R UP 2
teil4 YB 2-L UP 1
teil5 JB 2-L 47
teil5 JB 2-R 29
teil6 PB 2-L 1
teil2 JB müsste also 12 als count haben...
und
teil3 JB 43, hat es aber nicht.
Kann man das ändern?
Kommentar