Is combining (result sets) of “two queries with aggregate and group by” possible?
问题 1 Select id,count(*) as totalX FROM my_table WHERE x_factor = 1 GROUP BY id ResultSet : id totalX --------- -------------- 9 34 10 6 11 21 12 3 2 Select id,count(*) as totalY FROM my_table WHERE y_factor = 1 GROUP BY id ResultSet 2: id totalY --------- -------------- 9 334 10 56 11 251 12 93 Is there a way I can achieve this: id totalX totalY --------- -------------- -------------- 9 34 334 10 6 56 11 21 251 12 3 93 I would like the solution for Sybase 12.5 on RHEL 5, also I would like to