| Author: vipul 07 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
Hi, i think...you can't marge this two query if you used union then it is required all the column same in the both query. so you can't marge this two query but you can do this way
SELECT PB_BANK_CODE, PB_BANK_NAME, FROM GLAS_PDC_BANKS, ( SELECT SUM(PC_AMOUNT) FROM GLAS_PDC_CHEQUES WHERE PC_DUE_DATE BETWEEN :BLOCK01.DATE_FROM AND :BLOCK01.DATE_TO AND PC_BANK_FROM = :BLOCK02.PB_BANK_CODE AND NVL(PC_DISCD, 'X') = 'R' ) as total WHERE PB_COMP_CODE=@COMP_CODE AND PB_BANK_CODE IN (SELECT DISTINCT PC_BANK_FROM FROM GLAS_PDC_CHEQUES WHERE PC_COMP_CODE=@COMP_CODE AND PC_DUE_DATETIME BETWEEN @DATE_FROM AND @DATE_TO AND ISNULL(PC_DISCD,'X') = 'R') ORDER BY PB_BANK_CODE
Please Rate This Answer If They Helpful
Thanks & Regards Patel Vipul
|