Mistři v programování na #hovnokod

SQL #4485

celé zle (PP)

SELECT      (
                SELECT      TO_CHAR(HeadersID) HeadersID 
                FROM        datapt_eng_vw a
                WHERE       a.datapoint_id = b.COLUMN_VALUE
            ) headerId,
            (
                SELECT      TO_CHAR(DATAPT_TIMESTAMP, 'MM/DD/YY HH:MI:SS.ff3 AM') 
                FROM        datapt_eng_vw a
                WHERE       a.datapoint_id = b.column_value
            ) tdateForOrder, 
            (
                SELECT      DATAPT_TIMESTAMP
                FROM        datapt_eng_vw a
                WHERE       a.datapoint_id = b.column_value
            ) DATAPT_TIMESTAMP
FROM        TABLE(CAST (PKG_TDS_ENG.GET_SESSION_DATAPOINTS() AS TBL_DATAPOINT_SKEY)) b 
ORDER BY    DATAPT_TIMESTAMP desc;

Anonymous,