lemmin Posted November 9, 2010 Share Posted November 9, 2010 I am trying to get a result where field1 and field2 are not duplicates. I am able to do this by using SELECT DISTINCT field1, field2. Now I want to join a table to the result on the id fields that represent each row. How can I do that? Adding the id field to the select clause changes the result because it is included in the DISTINCT qualifier. Thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/218228-using-distinct-with-extra-fields/ Share on other sites More sharing options...
lemmin Posted November 9, 2010 Author Share Posted November 9, 2010 Oh, never mind. I guess grouping by multiple fields has the same affect. I didn't expect it to work that way. Quote Link to comment https://forums.phpfreaks.com/topic/218228-using-distinct-with-extra-fields/#findComment-1132361 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.