karlomutschler
Programmer
Hi,
One customer might have a numer of contracts for a certain tariff and rebate modell
The following query provides the following data
SELECT DISTINCT COUNT(customer_id)
,COUNT(contract_id)
,tariff
,rebate_model
FROM contract
WHERE (select criteria)
GROUP BY tariff, rebate_model
ORDER BY tariff ;
CustID ContrID Tariff Rebate_modell
4 4 1+ Fixed 04
203 203 1+ professional/int./profi talk
18 18 1+ Fixed 03
2 2 1+ Fixed 25
1 1 1+ Fixed 11
22 22 1+ business 24
but it should look like this:
CustID ContrID Tariff Rebate_modell
1 4 1+ Fixed 04
80 203 1+ professional/int./profi talk
10 18 1+ Fixed 03
1 2 1+ Fixed 25
1 1 1+ Fixed 11
12 22 1+ business 24
TIA and kind regards
Karlo
One customer might have a numer of contracts for a certain tariff and rebate modell
The following query provides the following data
SELECT DISTINCT COUNT(customer_id)
,COUNT(contract_id)
,tariff
,rebate_model
FROM contract
WHERE (select criteria)
GROUP BY tariff, rebate_model
ORDER BY tariff ;
CustID ContrID Tariff Rebate_modell
4 4 1+ Fixed 04
203 203 1+ professional/int./profi talk
18 18 1+ Fixed 03
2 2 1+ Fixed 25
1 1 1+ Fixed 11
22 22 1+ business 24
but it should look like this:
CustID ContrID Tariff Rebate_modell
1 4 1+ Fixed 04
80 203 1+ professional/int./profi talk
10 18 1+ Fixed 03
1 2 1+ Fixed 25
1 1 1+ Fixed 11
12 22 1+ business 24
TIA and kind regards
Karlo