In a single table,How to retrieve a employee-id of an
employee who works in more than one department?

Answer Posted / anonymous

select emp_id from employee where dept in (select distinct
dept from employee) group by emp_id having count(*) >1;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you find the maximum value in a column in db2?

650


What does db2 plan contain?

573


What is a plan and package in db2?

621


What does runstats do in db2?

607


What parameters are used to control the free space in DB2?

642






What does db2 mean?

587


Explain about rct in db2?

640


How to compare data between two tables in db2?

658


What is the syntax for creating a table in the db2 database?

628


What is runstats db2?

583


what is a corelated subquerry?

658


What is the use of db2?

586


What is buffer pool?

613


is it compulsory commitment control in journal?

2009


What are catalog tables in db2?

606