I want to count group by statement values and write control.
There is a table which have 3 fields; ItemId, TaxGroup and TaxItemGroup. Same itemId must have same taxgroup and taxItemGroup values. If lines which have same ItemId have different tax values, i should throw an exception.
I wrote this code but this return number of all records. How can i write this control?
while select count(RecId) from ActivityLineExtraLcl
group by Itemid, TaxGroup, TaxItemGroup
where ActivityLineExtraLcl.Amount != 0
if(ActivityLineExtraLcl.RecId > 1 )
throw error("Same ItemIds can't have different values!");