Hi,
How to get Count based upon value.
Id ServiceNumber Field CustOneValue CustTwoValue
1 Sn01 C1V 10.02 0.00
2 Sn02 C2V 0.00 38.23
3 Sn01 C1V 23.43 0.00
4 Sn01 C1V 0.00 0.00
5 Sn02 C2V 0.00 0.00
6 Sn02 C2V 0.00 34.23
conditions:
1) if field value=C1V then need to check whether values exists in CustOneValue field or not based upon service number if yes make it as one count or else don't consider for count.
2) if field value=C2V then need to check whether values exists in CustTwoValue field or not based upon service number if yes make it as one count or else don't consider for count.
my expected o/p
NoOfValues exists 4
Can you please provide me sample sql query to produce my expected o/p