Need help with data arrays |
Quote:From your two subqueries, I think you only need the SUM() fields, a.total_absence and s.total_sickness. I've tried leaving out the events.eventid in the subquery select but that throws the following error: Code: Error Number: 1054 so it seems to need the fields explicitly selected so it can do the join maybe? It's no big deal though, I can live with having the extra data in the result set. Just another point to note ... I've found that specifying the COALESCE like this, with the closing bracket after the AS variable: Code: COALESCE(SUM(amount) AS total_absence, 0) throws an error. Whilst specifying it like this (with closing brackets after the SUM(amount)) Code: COALESCE(SUM(amount),0) AS total_absence Thanks for your help, I learned a lot too. I'll pick up a copy of that book too! |
Messages In This Thread |
Need help with data arrays - by blackbulldog - 03-14-2015, 08:28 AM
RE: Need help with data arrays - by RobertSF - 03-14-2015, 04:01 PM
RE: Need help with data arrays - by blackbulldog - 03-15-2015, 05:04 AM
RE: Need help with data arrays - by RobertSF - 03-15-2015, 05:42 AM
RE: Need help with data arrays - by blackbulldog - 03-16-2015, 04:46 AM
RE: Need help with data arrays - by RobertSF - 03-16-2015, 12:34 PM
RE: Need help with data arrays - by blackbulldog - 03-16-2015, 01:27 PM
RE: Need help with data arrays - by RobertSF - 03-16-2015, 05:36 PM
RE: Need help with data arrays - by RobertSF - 03-16-2015, 03:24 PM
RE: Need help with data arrays - by blackbulldog - 03-17-2015, 01:57 AM
RE: Need help with data arrays - by RobertSF - 03-17-2015, 03:21 AM
|