samedi 25 avril 2015

Find total number Employees going to get salary?

I have following Table Structure

    select row_number() over(order by [Group]) as [Rowid],[Group],
[per/person],[TotalPerson]
     from
    (select 'A' as [Group],3000 as [per/person],
5 as [TotalPerson] union All
    select 'B' ,2000 ,10  
union All
    select 'C' ,1000 ,15)A

declare @amt_avail int=24000

I need to find two result set:
1)How Many Employee will get the salary order by Row id?
Total Emp
9

2)How Many Maximum Employee get the salary ??
Max Emp
19

Aucun commentaire:

Enregistrer un commentaire