I have a table with canc_code1 canc_code2 canc_code3. These are cancellation reasons.
There is a cancel codes table and a m_cancellations table.
cancel code TABLE
canc_code canc_desc
01 did not want
02 i do not have money
m_cancellations TABLE
contract canc_code1 canc_code2 canc_code3
10000 01 02 03
20000 02
30000 02
My query is:
select canc_code1, canc_code2, canc_code3, count(*) from m_cancellations
group by 1, 2, 3;
How do I display distinct canc_codes used by users on these 3 fields in just one result collum and also count how many of each has in the DB ?
I need something like this
canc_code totals
01 1522
02 1221
03 452
THANKS A LOT
There is a cancel codes table and a m_cancellations table.
cancel code TABLE
canc_code canc_desc
01 did not want
02 i do not have money
m_cancellations TABLE
contract canc_code1 canc_code2 canc_code3
10000 01 02 03
20000 02
30000 02
My query is:
select canc_code1, canc_code2, canc_code3, count(*) from m_cancellations
group by 1, 2, 3;
How do I display distinct canc_codes used by users on these 3 fields in just one result collum and also count how many of each has in the DB ?
I need something like this
canc_code totals
01 1522
02 1221
03 452
THANKS A LOT