182x Posted July 28, 2007 Share Posted July 28, 2007 Hey guys, I have been trying to write the following query in mysql it was made on oracle first just wondering how this can be achieved in mysql? SQL> select yr,sum(cnt) cnt 2 from (select yr,count(*) cnt 3 from test1 4 group by yr 5 union all 6 select yr,count(*) cnt 7 from test2 8 group by yr) 9 group by yr; Quote Link to comment https://forums.phpfreaks.com/topic/62206-query-help/ Share on other sites More sharing options...
jvrothjr Posted July 28, 2007 Share Posted July 28, 2007 unoin would be join is my guess Google search join on query Quote Link to comment https://forums.phpfreaks.com/topic/62206-query-help/#findComment-309722 Share on other sites More sharing options...
fenway Posted July 31, 2007 Share Posted July 31, 2007 That query should be just fine on mysql... have you tried it? Quote Link to comment https://forums.phpfreaks.com/topic/62206-query-help/#findComment-311930 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.