|Feb 22, 2013, 05:07 PM||#1|
Math in SQL? (HW)
I haven't even had 3 hours of hands on time with SQL yet, so I'm sorry if this comes off sounding like a very noobish question, but I can't figure out what I need to do to take the number returned by this query:
SELECT description, deaths1 FROM who.deaths INNER JOIN who.icd9 ON who.deaths.cause = who.icd9.cause where sex = 2 and country in (SELECT country FROM who.country where country_name like '%united kingdom%') and ryear = 1980 and deaths1 > 0 group by who.icd9.cause order by deaths1 desc limit 1;
Specifically, the question from my homework assignment is
I can't make what I've already written a subquery, because MySQL complains that it doesn't support limits inside of subqueries.
Alright, I can separately find the sum of all UK female deaths from 1980 with this query:
SELECT SUM(deaths1) deaths1 FROM who.deaths where sex = 2 and country in (SELECT country FROM who.country where country_name like '%united kingdom%') and ryear = 1980;
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
Last edited by ArtOfWarfare; Feb 22, 2013 at 09:53 PM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Kids Garden Math - Learn Math While Harvesting Fruits||PyjamasApps||iPhone and iPod touch Apps||0||Jul 16, 2013 04:00 AM|
|Software similar to SQL Dev and SQL plus?||doomfront||Mac Basics and Help||0||Nov 20, 2012 12:25 PM|
|3rd Grade Math: Summer Review Splash Math App||klkatielong||iPad Apps||0||Jul 18, 2012 12:56 PM|
|[Math App] Homework teaches kids math and reports to parents||Gaea deBomb||iPhone and iPod touch Apps||0||Jul 3, 2012 04:35 AM|
|5+7+10+5+2+3= ? Math Aloud ! true mental math ... left & right brain.||mobile.esd.mx||iPhone and iPod touch Apps||0||Jun 1, 2012 04:17 PM|
All times are GMT -5. The time now is 09:28 PM.