Доброго дня господа !
Делаю так
select Cast(1 as Numeric) F1,A.DAY,A.TYPE,A.BAREME,A.SUB0,A.SUB1,A.COMIS,AGENT,DEALER
from P00061242.PM_PRICING A where DAY=To_Date('12-10-2015','DD-MM-YYYY')
and BAREME=46 and TYPE=51
union all
select Cast(2 as Numeric) F1,A.DAY,A.TYPE,A.BAREME,A.SUB0,A.SUB1,A.COMIS,AGENT,DEALER
from P00061242.PM_PRICING0 A where DAY=To_Date('12-10-2015','DD-MM-YYYY')
and BAREME=46 and TYPE=51
Результат = Две записи
F1 DAY TYPE BAREME SUB0 SUB1 COMIS AGENT DEALER
1 1 12/10/2015 51 46 0.15 0 0 0.75210000 0
2 2 12/10/2015 51 46 0.15 0 0 0.75210000 0
Меняю union all на minus (2 на 1)
select Cast(1 as Numeric) F1,A.DAY,A.TYPE,A.BAREME,A.SUB0,A.SUB1,A.COMIS,AGENT,DEALER
from P00061242.PM_PRICING A where DAY=To_Date('12-10-2015','DD-MM-YYYY')
and BAREME=46 and TYPE=51
minus
select Cast(1 as Numeric) F1,A.DAY,A.TYPE,A.BAREME,A.SUB0,A.SUB1,A.COMIS,AGENT,DEALER
from P00061242.PM_PRICING0 A where DAY=To_Date('12-10-2015','DD-MM-YYYY')
and BAREME=46 and TYPE=51
Результат Одна запись !!!!!!!!!!!!! - ПОЧЕМУ ?
F1 DAY TYPE BAREME SUB0 SUB1 COMIS AGENT DEALER
1 1 12/10/2015 51 46 0.15 0 0 0.75210000 0