I need help to write a one SQL query. Following are the table name and column name for Oracle Receivable.
Table Column Name
RA_CUSTOMER_TRX_ALL bill_to_customer_id
cust_trx_type_id
Now, my task is to get average number of transaction types per customer, minimum number of transaction type per customer, maximum number of transaction type.
bill_to_customer_id cust_trx_type_id
1041 1020
1041 1021
1043 1020
1043 1021
1043 1023
1045 1023
1045 1027
1047 1020
1050 1027
1050 1021
---- ----
---- ----
---- ----
For above example, customer 1041 has 2 transaction type used, 1043 has 3 used, I am looking for all customer average how many transaction type used.
Now, I am looking for following type of result.
Average 1.25 transaction type used per customer
Minimum 1.0 transaction type used for customer
Maximum 4.0 transaction type used for customer