CREATE OR REPLACE VIEW VIEW_LC_REALDATA_DY AS
SELECT
terminalno,terminalname,
terminaltime,servertime,direction,
MAX(DECODE(dataitemno,'1',receivedata)) AS ady,
MAX(DECODE(dataitemno,'2',receivedata)) AS bdy,
MAX(DECODE(dataitemno,'3',receivedata)) AS cdy
FROM
MS_Realdata GROUP BY terminaltime,servertime,direction,terminalno,terminalname;