the results should be 15
SELECT x.amount FROM DONATIONS x , DONATIONS y GROUP BY x.amount HAVING SUM(SIGN(1-SIGN(y.amount-x.amount))) = (COUNT(*)+1)/2;
SELECT d.amount FROM ( SELECT Sum(d.amount) AS amount FROM donations d LEFT JOIN recipients r ON d.donation_id = r.donation_id WHERE donation_status = 'verified' OR donation_status = 'unverified' GROUP BY recipient_id) d, ( SELECT sum(d.amount) AS amount FROM gr_donations d LEFT JOIN grdp_recipients r ON d.donation_id = r.donation_id WHERE donation_status = 'verified' OR donation_status = 'unverified' GROUP BY recipient_id) dd GROUP BY d.amount HAVING sum(sign(1-sign(dd.amount-d.amount))) = (count(*)+1)/2),0
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE