sql - Joining Summary Tables in MYSQL -


I have two tables which I would like to be involved in MYSQL and I'm looking for the most optimized way to do this. Here's the problem:

I want to calculate the number of records based on one field (call customer call) in each table, then to produce a summary table, By using) Note that no customer is included in a customer, even if all the customers should be returned

  Table A customer -------- 1 1 4 4 5 6  

and

  Table B customer -------- 4 5 5 6 6 7 7 7  

In a summary table,

  summary customer count A calculation ----------------------- 1 2 0 4 2 1 5 1 3 6 1 2 7 0 3  

Any ideas about how to do something like this?

select customer, SM (source = 'A') CNT, SM (source = ' B ') CNT FM (Select' A 'Source, Customer UAN All Selection' B 'Customer Clients From Client to Clients) Customer By Clients;

Comments