I have "Mark" column(int) in table "Sample" and i need to create a function whihc should accept three parameters colunName, tableName and condition.
The logic inside the fucntion would be to calculate the average with rounding to the nearest based on the input patameters. This function has to be generic which can be used in various places of my school application.
the sample call : select dbo.CalculateSVG('mark','student','studentmark>50')
Please help me on creating gthe function for the above logic to make accurate avg with rounding.