Friday 11 October 2013

01Create a batch that finds the average pay rate of the employees and then lists the details of the employees who have a pay rate less than the average pay rate.

declare @avg_rate int
select @avg_rate=AVG (rate)
from humanResources.EmployeePayHistory
select * from humanResources.EmployeePayHistory
Where rate< @avg_rate
go

No comments:

Post a Comment