oracle of the problems encountered

** oracle of the problems encountered

Today met a wonderful question, there are differences in different databases, finding some value, some can be found, two tables associated with left join based on time. Specific code as follows:
the SELECT * the FROM (the SELECT A.D_ASTSTAT, A.C_PORT_CODE,
COUNT (*) RecordNum the AS,
MAX (AST.C_UPDATE_TIME) the AS C_UPDATE_TIME
the FROM A T_R_FR_ASTSTAT
the LEFT the JOIN C T_P_AB_PORT
the ON A.C_PORT_CODE = C.C_PORT_CODE
the LEFT the JOIN ( D_ASTSTAT the SELECT, C_PORT_CODE, the AS C_UPDATE_TIME C_KM_CODE
the FROM T_R_FR_ASTSTAT
the WHERE C_NAV_TYPE = 'the CHECK'
the AND C_KEY_CODE = 'ZZR') AST
the ON A.D_ASTSTAT = AST.D_ASTSTAT
the AND A.C_PORT_CODE = AST.C_PORT_CODE
the WHERE A.C_NAV_TYPE the IN ( 'TOTAL', 'TOTAL_ALL')
the AND A.D_ASTSTAT> = the TO_DATE ( '20,180,916', 'YYYYMMDD')
the AND A.D_ASTSTAT <= the TO_DATE ( '20,180,916', 'YYYYMMDD')
AND A.C_PORT_CODE IN (‘000174’)
GROUP BY A.C_PORT_CODE, A.D_ASTSTAT) d
left join (SELECT TO_DATE(‘20180916’,‘YYYYMMDD’) + ROWNUM - 1 AS DAYLIST FROM DUAL
CONNECT BY ROWNUM <= TRUNC(TO_DATE(‘20180916’,‘YYYYMMDD’) - TO_DATE(‘20180916’,‘YYYYMMDD’)) + 1) aa
on d.D_ASTSTAT = aa.DAYLIST ;

The effect of sub-query:
Here Insert Picture Description

Here Insert Picture Description
The above two data sets associated with only one condition, that date. . .
The results can not find value. . . I was drunk. Out a day thought to understand, the feeling is a problem with the database, how should I say, another database query so there can be found, tried several databases, some can and some can not.
Great God see which could help explain it at ~

Guess you like

Origin blog.csdn.net/qq_16939219/article/details/91045961