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

Answer Posted / varun

Select emp_id
from
employee
group by emp_id,dept
having count(*)>1;

Is This Answer Correct ?    26 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does db2 stand for?

598


What is the physical storage length of the data types: date, time, timestamp in the db2 database?

654


What happens in bind step in a db2 program?

569


What action db2 takes when a program aborts in the middle of a transaction?

659


Mention the location where the output received from explain statement is stored.

632






What is rct?

754


What are db2 objects?

641


What is the difference between cursor stability and repeatable read isolation levels?

688


Is db2 a mainframe database?

569


What is a db2 tablespace?

602


How many databases can be created inside an instance in db2 ?

605


What is buffer pool?

616


what is the sqlcode -501

11312


What is dbrm? When it will be created?

602


Why do we need reorg in db2?

566