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 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 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 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.