Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following script that is running
select mkpf~budat
,mkpf~mblnr
,ekko~lifnr
from mkpf
inner join mseg on mkpf~mblnr=mseg~mblnr and mkpf~mjahr=mseg~mjahr
inner join ekko on mseg~ebeln=ekko~ebeln
where mkpf~vgart='WE'
and mseg~ebeln in
(select ebeln
from rseg
inner join rbkp on rseg~belnr=rbkp~belnr and rseg~gjahr=rbkp~gjahr
where rbkp~tcode<>'MR1M');
when i try to count distinct the mkpf~mblnr with the following script
select count(distinct mkpf~mblnr),
ekko~lifnr,
mkpf~budat
from mkpf
inner join mseg on mkpf~mblnr=mseg~mblnr and mkpf~mjahr=mseg~mjahr
inner join ekko on mseg~ebeln=ekko~ebeln
where mkpf~vgart='WE'
and mseg~ebeln in
(select ebeln
from rseg
inner join rbkp on rseg~belnr=rbkp~belnr and rseg~gjahr=rbkp~gjahr
where rbkp~tcode<>'MR1M')
group by ekko~lifnr,
mkpf~budat;
i take the message that is in the attached file
How can i write the script in order to have the count of distinct mkpf~mblnr by ekko~lifnr and
mkpf~budat;
Thank you in advance.
If i remove the commas ,
select count(distinct mkpf~mblnr)
ekko~lifnr
mkpf~budat
from mkpf
inner join mseg on mkpf~mblnr=mseg~mblnr and mkpf~mjahr=mseg~mjahr
inner join ekko on mseg~ebeln=ekko~ebeln
where mkpf~vgart='WE'
and mseg~ebeln in
(select ebeln
from rseg
inner join rbkp on rseg~belnr=rbkp~belnr and rseg~gjahr=rbkp~gjahr
where rbkp~tcode<>'MR1M')
group by ekko~lifnr
mkpf~budat;
It is running and i take the message in the attached file
I am a bit confused on your post, as this appears to be SAP HANA SQL, we are not experts on that for sure in this forum, so I would recommend you post this in the SAP forums if that is the case, otherwise need further clarification on things.
Regards,
Brett