Author: isjf | Posted on: 11/2/2009 12:28:35 AM | Views : 762

can we use where caluse with Union? ( SQL SERVER)

this is the result of my query

SELECT 'PICK' AS TYPE,TBNO ,TBVALUE FROM TBDATA WHERE TBKEY='PKGOODS'  
UNION ALL  
SELECT 'PAY' AS TYPE,PYNO , PYNAME FROM PAYINFO


result:
TYPE    TBNO    TBVALUE
PICK    C    ??
PICK    KH    ??
PAY    01    ???
PAY    02    ???
PAY    03    ??
PAY    04    ??
PAY    05    ??
PAY    06    ??
PAY    07    ??
PAY    08    ??
PAY    09    ??
PAY    10    ???

I have ...

Go to the complete details ...