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; 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 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? Link to comment https://forums.phpfreaks.com/topic/62206-query-help/#findComment-311930 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.