In a single table,How to retrieve a employee-id of an
employee who works in more than one department?
Answers were Sorted based on User's Feedback
Answer / venkat
SELECT EMPLOYEE-ID FROM EMPLOYEE GROUP BY EMPLOYEE-ID,DEPARTMENT HAVING COUNT( DEPARTMENT ) > 1;
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / karthik
select dept,empid , count(*)
from table
goup by dept,empid
having count(*) > 1
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / g.kameswara reddy
select employee_id from employee table where department in
('a1','a2','b1','b2');
| Is This Answer Correct ? | 7 Yes | 11 No |
Answer / prasenjit_in
Select emp_id from employee where dept IN (select all
dept from employee);
| Is This Answer Correct ? | 4 Yes | 9 No |
Answer / ab
Select emp_id from employee where dept IN (select DISTINCT
dept from employee);
| Is This Answer Correct ? | 2 Yes | 8 No |
What is a db2 package?
How do I import data from excel to db2?
What is explain in db2?
What do you mean by storage group (stogroup)?
Bind concepts in DB2 cobol
10 Answers IBM, TCS, TRD, Virtusa,
One program calling 5 subprograms, its a cobol db2 program, after precompilation how many plans and packages will created?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?
If I have a view which is a join of two or more tables, can this view be updatable?
How to know the primary key of a table without defining the primary key in the table?
Can we declare DB2 HOST variable in COBOL COPY book?
Request to database but database is not available so what is was abend is raised?
Define db2 and its databases?