Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Need Query

$
0
0

Create Table Temp (DBName Nvarchar(50), MF Numeric(9,2), DP Numeric(9,2), Script Numeric(9,2), Resolve Numeric(9,2),) Insert Into('X','1','5','9','13'),('X','2','6','10','14'),('X','3','7','11','15'),('X','4','8','12','16'), ('Y','1','5','9','13'),('Y','2','6','10','14'),('Y','3','7','11','15'),('Y','4','8','12','16')

alter table Temp  add MF_score Numeric(9,2)

alter table Temp  add Script_score  NumeriC(9,2)

alter table Temp  add Resolve_score  Numeric(9,2)

alter table Temp  add DP_score Numeric(9,2)

Sum(MF),Sum(Script),Sum(Resolve),Sum(Dp)

which one is greater value we have to score as 10 .

for  example MF is max(sum) value MF_score is 10

If Script is scond highest we have  to compare Sum(Script) percentage of Sum(Mf) if it is greater to 90 and less than to 100 then Script_score 9

If Resolve is Thierd highest we have  to compare Sum(Resolve) percentage of Sum(Mf) if it is greater to 80 and less than to 90 then Script_score 8

If DP is Thierd highest we have  to compare Sum(DP) percentage of Sum(Mf) if it is greater to 70 and less than to 80 then Script_score 7

Max value  is Dynamic for MF,Script,Resolve,DP


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>