we have two tables emp,dept.emp has eno,ename,sal and dept
has deptno,dname.how to find maxsal of each dept wise.which
join used for joining.

Answer Posted / yuvaevergreen

Since there is no common column, it may not be possible to
join two tables.
if deptno is in emp table, correlated query can be used
emp
eno ename sal deptno
1 yuva 10 tn1
2 yuv1 20 tn2
3 yuv3 30 tn1


select * from emp as e1
where sal in
(sel max(sal) from emp as e2
where e1.deptno=e2.deptno);

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is teradata?

728


What interface is used to connect to windows based applications?

660


What are the scenarios in which full table scans occurs?

630


What is meant by a dispatcher?

657


What is oltp?

649






List out some of the primary characteristics of teradata.

642


Explain fastload in teradata?

708


How many types of joins are there in teradata?

614


How to Extract data from multiple legacy systems?

674


Why do you get spool space errors? How do trouble-shoot them?

683


What is a sparse index?

711


What is the use of stored procedures in teradata?

659


how can we analyze the locks ?

1779


How many codd's rules are satisfied by teradata database?

758


What are some commonly used bteq scripts?

632