jkkenzie Posted September 4, 2009 Share Posted September 4, 2009 $query_rs_events = "SELECT a.RecID, a.ID_Number, a.Emo_Number, a.First_Name,a.Middle_Name, a.Last_Name, a.Address, b.ShareValue, b.Id, b.Pk, b.Type FROM members a INNER JOIN (SELECT Id, Type, Pk, SUM(Amount) AS ShareValue FROM shares WHERE NOT(Description='Safaricom Corporate') GROUP BY Amount DESC) b ON a.ID_Number = b.Id"; This Inners Join is giving me few results as anticipated. I think the issue is IF there is no Join between the two tables, it doesn't give that result. How can i pick all data from both tables Irregardless if there is there is a Joint Or NOT Quote Link to comment https://forums.phpfreaks.com/topic/173142-help/ Share on other sites More sharing options...
rhodesa Posted September 4, 2009 Share Posted September 4, 2009 Use OUTER JOIN instead Quote Link to comment https://forums.phpfreaks.com/topic/173142-help/#findComment-912580 Share on other sites More sharing options...
jkkenzie Posted September 4, 2009 Author Share Posted September 4, 2009 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OUTER JOIN (SELECT Id, Type, Pk, SUM(Amount) AS ShareValue FROM shares WHERE NOT' at line 1 That is the result Quote Link to comment https://forums.phpfreaks.com/topic/173142-help/#findComment-912588 Share on other sites More sharing options...
rhodesa Posted September 4, 2009 Share Posted September 4, 2009 that's right...can't do that...try this: http://dev.mysql.com/doc/refman/5.0/en/outer-join-simplification.html Quote Link to comment https://forums.phpfreaks.com/topic/173142-help/#findComment-912601 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.