can any one answer this query,thank you in advance
Table 1 has 2 columns: EmployeeId, T shirtsize(values can
be 1,2,3)
Table 2 has 2 columns: EmployeeId, Region
Write SQL to Find the region which has the largest number
of people with Tshirt size=3
Answer Posted / lakram5455
SELECT a.Region FROM
(SELECT TOP(1) a.TSize, COUNT(a.EId) AS TotalCount, b.Region
FROM emp a INNER JOIN Region b ON b.EId = a.EId WHERE TSize
= 3 GROUP BY a.TSize, b.Region ORDER BY TotalCount DESC) a
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to create a dynamic cursor with the dynamic option?
Can two tables have the same primary key?
Explain about temporary stored procedure?
When should you use an instead of trigger?
What is single-user mode and what are the steps you should follow to start sql server in single-user mode?
What is function of CUBE ?
Show Practically Sql Server Views are updatable?
Do you know nested transaction?
What is apply operator in sql?
How to read data in a table with "select" statements?
Where are full-text indexes stored?
What is the openxml statement in sql server?
What are two difference between sql azure and azure tables?
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
How to connect php with different port numbers?