Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ankur_bhargava2000
Starting Member
4 Posts |
Posted - 2005-07-13 : 14:32:01
|
| hi every onei am facing a little bit of problem in solving the queriescan anyone provide me the solution of these queriesi have a table called employeefeilds are1.empid2.empname3.salary4.cityand i want the following queries solved1. duplicate employee name with their phone no2. max salary row from the table3. second highest salary from the table4. empname getting highest salary in cities group by cityplease provide me the solution of above and also tell me the site where i can get different advanced queries so that i could understand them.thanking uankur bhargava |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-07-13 : 14:42:10
|
| Sorry but we do not answer homework questions here.I'll give you hints though.1. GROUP BY with HAVING will work2. MAX3. MAX with a WHERE clause4. Your teacher practically gave you the answer with this oneTara |
 |
|
|
SreenivasBora
Posting Yak Master
164 Posts |
|
|
ankur_bhargava2000
Starting Member
4 Posts |
Posted - 2005-07-15 : 02:18:41
|
| hi this is not a home work i am trying on these queriesbut not able to solve these queries. i do not know how to use aggrgate functions inhaving clausefor ex i want to know the complete detail of emp gettting maximum salaryi am writing this query but this doesnt work for meSELECT Tbl_Emp.EmpId, Tbl_Emp.EmpName, Tbl_Emp.City, Max(Tbl_Emp.Salary) AS [Max Of Salary]FROM Tbl_EmpGROUP BY Tbl_Emp.EmpId, Tbl_Emp.EmpName, Tbl_Emp.Cityso any one can provide me the solutions of above queries i will be greatfulwith thanksankur |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-07-15 : 02:25:27
|
| you need to try subqueries and/or joins--------------------keeping it simple... |
 |
|
|
ankur_bhargava2000
Starting Member
4 Posts |
Posted - 2005-07-19 : 14:17:01
|
| hi all ys i know these queries r easier for one who know. but i am learning sql self therefore i dont know these queries and even dont know to use query builders.so if any one can help me out of this i will be thankful ankur |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-20 : 01:34:55
|
| See Books On Line for Subquery, Joins, Max, HavingMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|