max_w1 Posted June 4, 2011 Share Posted June 4, 2011 SELECT customerNumber id, contactLastname name FROM customers UNION SELECT employeeNumber id,contactLastname name FROM employees the problem with the query is it eliminates the duplicate records, is there a way i can do this without eliminating? Quote Link to comment https://forums.phpfreaks.com/topic/238404-mysql-union-without-eliminating-duplicate-records/ Share on other sites More sharing options...
requinix Posted June 4, 2011 Share Posted June 4, 2011 Use UNION ALL. Quote Link to comment https://forums.phpfreaks.com/topic/238404-mysql-union-without-eliminating-duplicate-records/#findComment-1225178 Share on other sites More sharing options...
max_w1 Posted June 4, 2011 Author Share Posted June 4, 2011 Thanks it worked Quote Link to comment https://forums.phpfreaks.com/topic/238404-mysql-union-without-eliminating-duplicate-records/#findComment-1225185 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.