没有进行分页的语句:大概3秒出结果,一旦加上rownum分页就要很长时间才能查出结果
SELECT GU.GUEST_NAME,
GU.ADDR_ONE || GU.ADDR_TWO || GU.ADDR_THREE || GU.ADDR_FOUR GUADDR,
DEV.STB_TYPE,
SIG.SIGNAL_STRENGTH,
SIG.TUNER_SNR,
SIG.SIGNAL_BER,
CM.UP_CM_SIGNAL_STRENGTH,
CM.DOWN_CM_SIGNAL_STRENGTH
FROM (SELECT MAC_ADDR, SIGNAL_STRENGTH, SIGNAL_BER, TUNER_SNR
FROM UT_SIGNAL_NEW USIG
WHERE TIME = (SELECT MAX(TIME)
FROM UT_SIGNAL_NEW
WHERE MAC_ADDR = USIG.MAC_ADDR)) SIG
FULL JOIN (SELECT MAC_ADDR,
DOWN_CM_SIGNAL_STRENGTH,
UP_CM_SIGNAL_STRENGTH
FROM UT_CM_NEW UCM
WHERE TIME = (SELECT MAX(TIME)
FROM UT_CM_NEW
WHERE MAC_ADDR = UCM.MAC_ADDR)) CM ON (UPPER(SIG.MAC_ADDR) =
UPPER(CM.MAC_ADDR))
JOIN (SELECT MAC_ADDR
FROM UT_ONOFF_NEW UTNE
WHERE TIME = (SELECT MAX(TIME)
FROM UT_ONOFF_NEW
WHERE MAC_ADDR = UTNE.MAC_ADDR)
AND TYPE = 0) AA ON (UPPER(SIG.MAC_ADDR) =
UPPER(AA.MAC_ADDR) or
UPPER(AA.MAC_ADDR) =
UPPER(CM.MAC_ADDR))
left outer JOIN GUEST GU ON (UPPER(GU.MAC_ADDR) =
UPPER(AA.MAC_ADDR))
LEFT OUTER JOIN (SELECT DISTINCT MAC_ADDR, STB_TYPE
FROM PB_DEVICE_INFO) DEV ON (UPPER(GU.MAC_ADDR) =
UPPER(DEV.MAC_ADDR))
WHERE (SIGNAL_STRENGTH BETWEEN
(SELECT MINVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'SIGNAL_STRENGTH') AND
(SELECT MAXVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'SIGNAL_STRENGTH') OR
SIGNAL_STRENGTH IS NULL)
AND (SIGNAL_BER BETWEEN
(SELECT MINVALUE_BER
FROM RANGE
WHERE TYPE = 1
AND NAME = 'SIGNAL_BER') AND
(SELECT MAXVALUE_BER
FROM RANGE
WHERE TYPE = 1
AND NAME = 'SIGNAL_BER') OR SIGNAL_BER IS NULL)
AND (TUNER_SNR BETWEEN
(SELECT MINVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'TUNER_SNR') AND
(SELECT MAXVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'TUNER_SNR') OR TUNER_SNR IS NULL)
AND (DOWN_CM_SIGNAL_STRENGTH BETWEEN
(SELECT MINVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'DOWN_CM_STRENGTH') AND
(SELECT MAXVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'DOWN_CM_STRENGTH') OR
DOWN_CM_SIGNAL_STRENGTH IS NULL)
AND (UP_CM_SIGNAL_STRENGTH BETWEEN
(SELECT MINVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'UP_CM_SIGNAL_STRENGTH') AND
(SELECT MAXVALUE
FROM RANGE
WHERE TYPE = 1
AND NAME = 'UP_CM_SIGNAL_STRENGTH') OR
UP_CM_SIGNAL_STRENGTH IS NULL)
ORDER BY AA.MAC_ADDR |
|