Ho le seguenti query :
codice:
select count(*) from (
Select p_n,order_n,0.00 as still_waiting from order_pn
WHERE (order_pn.quantity - order_pn.qty_in) <=0
union
Select p_n,order_n,0.00 as still_waiting from order_pn
WHERE (order_pn.quantity - order_pn.qty_in) >0
) as d
e
codice:
select count(*) from (
Select p_n,order_n,0.00 as still_waiting from order_pn
) as d
la prima mi da come risultato 1766 mentre la seconda 1819, perchè?Se la prima la faccio in maniera separata mi da 1214 e 605 dove il totale appunto è 1819 ma se le metto insieme con la union il risultato è 1766 ... mi spiegate il motivo?