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) 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. Link to comment https://forums.phpfreaks.com/topic/241706-duplicate-results/#findComment-1242494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.