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 / ashok

select b.Region, a.TSize, Count(a.TSize)
as TSizecount from Table1 a,Table2 b where a.Empid =
b.Empid and a.TSize=3 group by region, TSize order by
Region, count(*), TSize desc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Create and insert into temp table in sql server?

579


Explain full-text query in sql server?

530


What is create statement?

523


How to install sql server 2005 express edition?

587


How to create a scrollable cursor with the scroll option?

492






What is the difference between a function and a trigger?

571


How you can change a cross join into an inner join?

547


Explain some stored procedure creating best practices or guidelines?

514


Mention what are the different types of ssrs reports?

98


What are views in ms sql server?

594


What is data source document?

544


Do you know what is a with(nolock)?

598


What is the status of services on passive node for failover cluster in sql server? : sql server database administration

629


When cursors are useful?

573


What is unique key constraint?

628