Jump to content

query help


182x

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.