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 / anil panwar
Hi Shivaraj
the ans you have given that is correct but
anyway,
if different employee id have same age and different region
and region is null in that case will not show Null region
for that employee
it may be solution....
select t1.id, t2.region from t1 left outer Join t2
on t1.id=t2.id
where t1.id in (select id from t1 where age=(select max(age)
from t1)) group by t1.id, t2.region
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is it possible for a stored procedure to call itself or recursive stored procedure?
How to scale out a federation by Sql statement?
Can we write trigger for view?
Can we perform backup restore operation on tempdb? : sql server database administration
Explain the truncate command?
Explain can you implement data mining in ssrs?
What is the difference between inner join and equi join?
What does the not null constraint do?
What is awe?
Explain system rowset functions?
What is the use of toad or sqldbx.?
What is the difference between substr and charindex in the sql server?
explain declarative management framework (dmf) in sql server 2008?
John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?
Explain concepts of analysis services?