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's the Maximum Length of SQLCA and what's the content of SQLCABC?
What is a cursor in programming?
What is the physical storage length of timestamp data type?
What is DYNSLT keyword? How do you perform selection using DYNSLT
What is db2 isolation?
what is a trigger and types of triggers
What is a root page?
What is a Foreign Key?
0 Answers Tavant Technologies, Zensar,
4. A DB2 application is bound with uncommitted Read isolation level.It issues a request that retrieves 20 rows out of 200000 in the table. Which of the following descrbes the rows that are locked as a result of this request? a. None of the rows are locked. B.The retrieved rows are locked. C.The last row of the result set is locked. D.The rows not previously updated by another application are locked.
Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....
Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?
What does db2 plan contain?