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 / pradip jain
Himesh is also correct with little change..
select top 1 region,count(*) e
from t2 JOIN t1 ON (t1.eid = t2.eid and
t1.[T-Shirt_Size] = 3)
group by region
order by e desc
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What options are there to delete rows on the publisher and not on the subscriber? : sql server replication
List out what other servers you can use with ssrs?
What is the difference between left and right outer join?
what are the different types of SSRS reports?
Characterize join and name diverse sorts of joins?
Does full backup break log chain?
What is difference between rownum and row_number?
What are wait types?
What stored by the master? : sql server database administration
What is the difference between writing data to mirrored drives versus raid5 drives
what types of replication are supported in sql server? : Sql server database administration
What are the database roles? : sql server security
What is the use of =,==,=== operators?
How to select true false based on column value in sql server?
What is difference between commit and rollback when used in transactions?