I HAVE 2 TABLES ONE IS EMP_TABLE AND ANOTHER
DEPT_TABLE.EMP_TABLE CONTAINS NAME,DEPTNO,DEPTNAME,LOCATION
AND DEPT_TABLE CONTAINS DEPTNO,DOJ(DATE OF JOINING).I WANT
TO DISPLAY NAME,DEPTNAME,DOJ AND WHO ARE JOINED BETWEN 01-
JAN-2007 TO 01-JAN-2008?

Answer Posted / nimsatprasad

Try this if wrong let me know...

SELECT A.NAME
,A.DEPTNAME
,B.DOJ
FROM EMP_TABLE A
,DEPT_TABLE.EMP_TABLE B
WHERE A.DEPTNO = B.DEPTNO
AND B.DOJ BETWEEN '01-01-2007' AND '01-01-2008'
;

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we read records for specific member in CL? AND rpg?

235


What is lock escalation in db2?

574


Why do we bind in db2?

634


what is the sqlcode -501

11309


What is the connection string to connect to the DB2 Database ?

614






What is the purpose of rollback and commit?

595


Define buffer pool.

628


What is table space in db2?

584


What does db2 stand for?

598


What is db2 stogroup?

677


What is sqlca’s maximum length?

678


Mention data types used in db2 ?

681


Is db2 a mainframe database?

569


When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?

3120


What is the role of union all and union

650