ryanjsells Posted November 18, 2012 Share Posted November 18, 2012 I am trying to use the Union statement in a sql statement in MySQL and it's not working. When using the Union statement it is NOT supposed to return duplicate entries from the 2 tables, but for some reason mine is. Is there a setting I am missing? SELECT CUST_NUM, CUST_LNAME, CUST_FNAME FROM customer UNION SELECT CUST_NUM, CUST_LNAME, CUST_FNAME FROM customer_2; Quote Link to comment https://forums.phpfreaks.com/topic/270858-union-statement-not-working-in-mysql/ Share on other sites More sharing options...
jazzman1 Posted November 19, 2012 Share Posted November 19, 2012 No, there is something rotten in the state of Denmark Could you describe the tables for us? mysql>DESCRIBE customer; mysql>DESCRIBE customer_2; Quote Link to comment https://forums.phpfreaks.com/topic/270858-union-statement-not-working-in-mysql/#findComment-1393494 Share on other sites More sharing options...
fenway Posted November 21, 2012 Share Posted November 21, 2012 What makes you think they're not distinct -- did you check for trailing spaces / whitespace? Quote Link to comment https://forums.phpfreaks.com/topic/270858-union-statement-not-working-in-mysql/#findComment-1393986 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.