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 |
wht is d/f b/w inner join and outer join ? d/f group by and order by having by ?
Define declaration generator (dclgen).
What do the initials DDL and DML stand for and what is their meaning?
If I have a view which is a join of two or more tables, can this view be updatable?
What is tablespace?
How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host variable in WHERE clause)
wht r the requirements for writing a cobol-db2 pgm ?
what's the error code for Unique Index Violation?
What is the STOSPACE Utility used for?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
What is a cursor and what is its function?
Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened?