please can anyone answer this query
Table 1 has 2 columns: EmployeeId,Age
Table 2 has 2 columns: EmployeeId, Region
Write SQL to Find the region who has the oldest person
Answer Posted / krishna murari chaubey
create table Employee(empId int,age int)
create table Area(empId int,Region varchar(20))
Use Inner Join
select e.empid,e.age,a.region from Employee e inner join
area a on e.empid=a.empid and e.age in
(select max(age) from Employee)
OR
select empid,region from area where empid in
(select empid from Employee where age
in(select max(age) from Employee))
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How to move database physical files in ms sql server?
what is raid? : Sql server database administration
How to get a list of all tables with "sys.tables" view in ms sql server?
What are the system database in sql server 2008?
What is cross join in sql server joins?
How to declare and use cursor variables?
is there a column to which a default can't be bound? : Sql server database administration
What does executeupdate return?
What is use of attribute hierarchy optimized state? : sql server analysis services, ssas
Explain different types of lock modes in sql server 2000?
What is wide table?
What is reference section?
What is a db view?
can you instantiate a com object by using t-sql? : Sql server database administration
How to get the definition of a user defined function back?