Jaynesh Posted July 11, 2011 Share Posted July 11, 2011 Hello I am getting duplicate results using my query. I have identified my problem (in red) but I'm not sure how to fix it. I want either one or the other. not both. "SELECT DISTINCT * FROM dbPosts JOIN dbUsers ON dbPosts.username_id = dbUsers.id JOIN dbFriends ON (dbPosts.username_id = dbFriends.user_id) OR (dbPosts.username_id = dbFriends.friend_id) Quote Link to comment https://forums.phpfreaks.com/topic/241706-duplicate-results/ Share on other sites More sharing options...
fenway Posted July 14, 2011 Share Posted July 14, 2011 You really don't want DISTINCT * -- what do you want? My guess is you need to JOIN twice, then COALESCE. Quote Link to comment https://forums.phpfreaks.com/topic/241706-duplicate-results/#findComment-1242494 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.