select (Studentid+semid) as total , 30+((50-30)* (cast(24 as float)/cast(50 as float))) as cal from student
WITH Sample_CTE (total) AS ( SELECT (Studentid+semid) as total from student ) SELECT 30+((50-30)* (cast(total as float)/cast(50 as float))) AS cal FROM Sample_CTE;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)