I'm trying to run this :
 
SELECT DISTINCT A.B_IP FROM w3t_Posts A , w3t_Users B WHERE A.B_PosterID =
B.U_Number and B.U_Username = 'user1' 
UNION
SELECT DISTINCT C.B_IP FROM w3t_Posts C , w3t_Users D WHERE C.B_PosterID =
D.U_Number and D.U_Username = 'user2' 

and it's failing saying 
 
SQL Error: You have an error in your SQL syntax near 'UNION SELECT DISTINCT
A.B_IP FROM w3t_Posts A , w3t_Users B WHERE A.B_PosterID ' at line 2
SQL Error #: 1064
Query: SELECT DISTINCT A.B_IP FROM w3t_Posts A , w3t_Users B WHERE
A.B_PosterID = B.U_Number and B.U_Username = 'Simon' UNION SELECT DISTINCT
A.B_IP FROM w3t_Posts A , w3t_Users B WHERE A.B_PosterID = B.U_Number and
B.U_Username = 'MartyX' 

 
I've been using DB2 SQL for ages.
 
 

Reply via email to