|
|
Archives of the TeradataForum
Message Posted: Tue, 17 Jul 2012 @ 15:24:15 GMT
Subj: | | Re: Select records with valid values except the key field |
|
From: | | naresh.neelam |
Hi Jay,
Your senario will acheive through the following logic, but any way its give performance issues i think , may be its helpful for you
SELECT EMPLOYEE_NUMBER,MANAGER_EMPLOYEE_NUMBER,DEPARTMENT_NUMBER,JOB_CODE,
LAST_NAME,FIRST_NAME,HIREDATE,BIRTHDATE FROM
(SELECT EMPLOYEE_NUMBER,MANAGER_EMPLOYEE_NUMBER,DEPARTMENT_NUMBER,JOB_CODE,
LAST_NAME,FIRST_NAME,HIREDATE,BIRTHDATE, RANK() OVER(PARTITION BY NULL ORDER BY MANAGER_EMPLOYEE_NUMBER,
DEPARTMENT_NUMBER,JOB_CODE, LAST_NAME,FIRST_NAME,HIREDATE,BIRTHDATE )
AS RANK_1 FROM STGDB.EMPLOYEE
QUALIFY RANK_1<>1) ABC
Thanks,
Naresh Neelam
| |