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

select t1.id, t2.region from table t1 left outer Join table2 t2
on t1.id=t2.id
where t1.id in (select id from table1 where age=(select
max(age) from table1))

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does dbcc checkdb requires db to be in single_user mode? : sql server database administration

520


1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?

1542


What are the types of user defined functions in sql server?

504


How to display a past time in days, hours and minutes?

575


You want to implement the one-to-one relationship while designing tables. How would you do it?

533






what is a sub-report?

96


If user is owning any SQL Objects, can we drop that user

1607


How do you delete duplicate records in sql server?

511


What is the difference between a check constraint and a rule?

626


What is query optimizer in sql server?

551


explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?

1985


Differentiate between mongodb vs. Sql server?

579


What is a rownum?

505


Why are you getting errors when creating a new odbc dsn?

591


What is the process of normalization?

558