Viewing 15 posts - 14,746 through 14,760 (of 15,381 total)
Start by getting your results in order of average salary smallest to largest.
May 2, 2011 at 1:48 pm
Start by getting your results in order of average salary smallest to largest.
May 2, 2011 at 1:21 pm
This is where you need to add TOP and order by...
May 2, 2011 at 1:20 pm
normanshongo2003 (5/2/2011)
select d.Department_No,(AVG(Annual_Salary)) AS Lowest_Avg_Annual_Salaryfrom Departments d
inner join
Employees e
on d.Department_No=e.Department_No
group by D.Department_No
Department_NoLowest_Avg_Annual_Salary
1011180.000000
2015233.333333
3013700.000000
5020746.428571
609715.789473
7018400.000000
8014400.000000
9081666.666666
11019797.500000
1908792.307692
Now you are getting there. Now how can you get the one with the lowest avg?
May 2, 2011 at 1:16 pm
Forget your assignment for now. Modify your query to get each department and their avg annual salary.
(Hint: Remove the MIN function)
Yes I could create the sql in about 10...
May 2, 2011 at 1:15 pm
LOL. Can you get a query that gets all departments with their average annual salary? (hint: removed the MIN function). Don't worry about if it is the final answer (it...
May 2, 2011 at 1:10 pm
Well you are still nesting aggregates which will never work. Logically it just doesnt make sense. Create your query to get the average for all departments, then use TOP and...
May 2, 2011 at 1:06 pm
Looks like you had a query to get the average monthly salary for each department. Now how do you find the one with the lowest?
May 2, 2011 at 1:04 pm
As Dave and I both suggested you should use the TOP clause and order by your aggregate.
May 2, 2011 at 1:00 pm
normanshongo2003 (5/2/2011)
List the department number and the annual salary of the department with the lowest average annual salary
select d.Department_No,MIN(AVG(Annual_Salary)) AS Lowest_Avg_Annual_Salary
from Departments...
May 2, 2011 at 12:57 pm
Do you currently have a maintenance plan for regular backups? If so, then just copy the backup to wherever you want it to be. If you don't, you need to.
May 2, 2011 at 11:53 am
Didn't really get what you have tried on your own but something like this should get you in the right direction...
select ID, data, (select top 1 VDate from dummy where...
May 2, 2011 at 11:48 am
ok so here is what I have for some sample ddl and data...
create table dummy
(
data varchar(25),
VDate varchar(25),
ID int
)
insert dummy select 'xyz', 'Jan 1, 1990', '1'
union all
select 'pdq','','2'
union all
select 'str','','3'
union all
select...
May 2, 2011 at 11:28 am
Viewing 15 posts - 14,746 through 14,760 (of 15,381 total)