Toad World® Forums

Subquery issue

There appears to be a problem when I create a subquery now in the beta v3.1.0.464. It is adding a 1=2 in the query. Any ideas - see query below:

SELECT VISIT_TOTALS_V.SITE_ID,
VISIT_TOTALS_V.FACILITY_ID,
VISIT_TOTALS_V.ACCOUNT_NO,
VISIT_TOTALS_V.TOTAL_CHARGES,
VISIT_TOTALS_V.TOTAL_PAYMENTS,
VISITS_V.DISCHARGE_DATE
FROM ( FIN.VISIT_TOTALS_V VISIT_TOTALS_V
INNER JOIN
(SELECT VISIT_CHARGES_V.FACILITY_ID, VISIT_CHARGES_V.ACCOUNT_NO
FROM FIN.VISIT_CHARGES_V VISIT_CHARGES_V
INNER JOIN
FIN.MST_CHARGES_V MST_CHARGES_V
ON (VISIT_CHARGES_V.SITE_ID = MST_CHARGES_V.SITE_ID)
AND (VISIT_CHARGES_V.CHARGE_NO =
MST_CHARGES_V.CHARGE_NO)

            **WHERE     1 = 2

** AND ( (VISIT_CHARGES_V.FACILITY_ID = 5)
AND (MST_CHARGES_V.GL_DEPT = 20705)
AND (VISIT_CHARGES_V.SERVICE_DATE >=
TO_DATE (‘2010-07-01 00:00:00’,
‘yyyy/mm/dd hh24:mi:ss’)))) Subquery
ON (VISIT_TOTALS_V.FACILITY_ID = Subquery.FACILITY_ID)
AND (VISIT_TOTALS_V.ACCOUNT_NO = Subquery.ACCOUNT_NO))
INNER JOIN
FIN.VISITS_V VISITS_V
ON (VISIT_TOTALS_V.FACILITY_ID = VISITS_V.FACILITY_ID)
AND (VISIT_TOTALS_V.ACCOUNT_NO = VISITS_V.ACCOUNT_NO)

You are right the 1= 2 has been left in beta by mistakeand now it’s fixed.

Thank you for reporting it.

Aleksey