Click here to Skip to main content
15,899,313 members

Comments by xoxo29401 (Top 2 by date)

xoxo29401 2-May-22 11:31am View    
Thanks Wendelius for your time and reply
When I do one pivot table. Below query is working but changedate and changeby are in one column and do not calculate max(changedate). How can i do in two join pivot.

SELECT distinct W.*, v.vendor_name,lf.SITEID
FROM (SELECT DISTINCT LEMNUM,
STATUSID,
CHANGEDATE,changeby
FROM BI_HZ_ETL.LEM_CNRLEMSTATUS
WHERE STATUS NOT IN('DELETED','NEW'))
PIVOT ((MAX (CHANGEDATE ||'//'||CHANGEBY))
FOR STATUSID
IN (20 Submit,
40 WAPPR,
50 APPR,
55 POST,
60 COMP)) W
left join BI_HZ_ETL.LEM_FACTS lf on(lf.LEMNUM=W.LEMNUM)
join BI_HZ_ETL.LEM_VENDOR V on(v.vendor_ID=lf.vendor)
xoxo29401 2-May-22 10:26am View    
getting below error message
Message=ORA-00928: missing SELECT keyword