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

How do I delete a column in db2?

678


What is an instance database?

600


Is db2 a mainframe database?

567


How will you return the number of records in table?

516


Explain the function done by data manager?

853






Is ibm db2 free?

573


What is the use of with ur in db2?

615


What is an instance in db2?

563


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

626


What is cobol db2?

568


Explain correlated sub-queries.

587


Why cursor is used in db2?

572


What are union and union all?

537


Can we delete records from view?

566


What is the cobol picture clause of the db2 data types date, time, timestamp?

615