Question: How can I use function as parameter of another function and assign it to a delegate 

```
public class myClass
{
    public delegate void myDelegate(double x, string s);
    //declaration of   delegate
    public void func(double x, string s)
    {
      dosomethings...
    }
    // what is the declaration of the argument 'Function declaration'
    public void myFunction('Function declaration' function)
    { 
      myDelegate deFunc;
      deFunc = function;
    }
    }
    static void Main(string[] args)
    {
        myFunction(func);
    }
}

```

Answer: 
I guess you're summing these values not in the scope they are already defined, so try to build your query like:

```
select (SC + UR) as SUM1 from (select field1, 
       case when field2 like 'S%' 
         then '1'
       end as SC,
       case when field2 like 'L%' 
         then '2'
       end as UR 
from table1);

```

Another approach:

```
with temp as (
    select field1, 
           case when field2 like 'S%' 
             then '1'
           end as SC,
           case when field2 like 'L%' 
             then '2'
           end as UR 
    from table1)
select (t.SC + t.UR) as SUM1 from temp t;

```
yes it is possible to sum them if you do something like below

;with cte as (
select \* ,case when tariff\_name like 'S%'

 end as SC
 ,case when tariff\_name like 'S%'

 end as UR 

from SomeTable

)

select \*,SC+UR as [sum]

from cte