i have two tales ,details of orders: OrdersAOrderNo Part RefNo BonusFlag Amount1 a 1 N 100
OrdersBOrderNo Part RefNo BonusFlag Amount1 a 1 N 1001 a 1 Y 0
i want to join between orders that have bonus and thos that do not have.if i do not have bonus rows,i also wnat to introduce this rowso i want to get 3 rows in my example:but in my query i get just one,why?SELECT *OrdersA OrdersA FULL JOIN OrdersB OrdersB ON (OrdersA.RefNo =Ordersb.RefNo ANDOrdersA.Part =Ordersb.Part)WHERE OrdersA.BonusFlag ='Y' AND OrdersB.BonusFlag ='Y'UNIONSELECT *OrdersA OrdersA FULL JOIN OrdersB OrdersB ON (OrdersA.RefNo =Ordersb.RefNo ANDOrdersA.Part =Ordersb.Part)WHERE OrdersA.BonusFlag ='N' AND OrdersB.BonusFlag ='N'