To Set a value of a parameter using Case


DECLARE @TotalMinutes INT 
SET @TotalMinutes =180
declare @TotalCharges money=0;


 SELECT
   
   @TotalCharges = CASE
     WHEN @TotalMinutes <=60 OR @TotalMinutes <=120 THEN 0
     WHEN @TotalMinutes <=60 OR @TotalMinutes <=120 THEN 1
   END

  

Comments

Popular posts from this blog

Grouping Sets, With Rollup and With Cube example

Adding Page brake aganist group values

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases