database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
ㆍSybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Sybase Q&A 1463 게시물 읽기
No. 1463
이주환님~ DB Queyr한번 봐주세요
작성자
sony
작성일
2006-03-20 19:55
조회수
3,509

select
to_id, to_nm
from
(
/*피평가자*/
select
emp_num to_id, emp_nam to_nm
from
(
select
a.emp_num, a.emp_nam, isnull(prgs_stts, '00') prgs_stts
from
(
select
a.org_cd, a.org_nam, a.emp_num, a.emp_nam,b.vlt_grop_cd,
( select prgs_stts
from bdap042t
where vlt_year = '2005'
and sequ_cd = '1'
and vlt_clss_cd = '1'
and nonappraiser = a.emp_num
) prgs_stts,
( select ablt_vlt_use_flg
from bdap038t
where vlt_year = '2005'
and vlt_grop_cd = b.vlt_grop_cd
) use_flg
from hmpa001m a, bdap036t b
where b.vlt_year = '2005'
and a.lineal_cd = b.lineal_cd
and a.jpstn_cd = b.jpstn_cd
and a.jtit_cd = b.jtit_cd
) a
where use_flg = '1'
and emp_num not in ( select nonappraiser
from bdap102t
where vlt_year = '2005'
and sequ_cd = '1'
and exld_clss_cd != ''
)
) a
where prgs_stts < '07'
and prgs_stts in ('00', '01', '02') //평가전, 평가중
/*목표완료, 1차목표협의, 2차목표합의*/
select
to_id, emp_nam to_nm
from
(
select
case when prgs_stts = '03' then /*목표완료*/
case when confi_seqc1_apps != '' then confi_seqc1_apps
else case when confi_seqc2_apps != '' then confi_seqc2_apps
else appraiser
end
end
when prgs_stts = '04' then /*1차목표협의*/
confi_seqc2_apps
when prgs_stts = '05' then /*2차목표협의*/
appraiser
end to_id
from
(
select
prgs_stts, confi_seqc1_apps, confi_seqc2_apps, appraiser
from
(
select
a.emp_num, a.emp_nam, isnull(prgs_stts, '00') prgs_stts
from
(
select
a.org_cd, a.org_nam, a.emp_num, a.emp_nam,b.vlt_grop_cd,
( select prgs_stts
from bdap042t
where vlt_year = '2005'
and sequ_cd = '1'
and vlt_clss_cd = '1'
and nonappraiser = a.emp_num
) prgs_stts,
( select ablt_vlt_use_flg
from bdap038t
where vlt_year = '2005'
and vlt_grop_cd = b.vlt_grop_cd
) use_flg
from hmpa001m a, bdap036t b
where b.vlt_year = '2005'
and a.lineal_cd = b.lineal_cd
and a.jpstn_cd = b.jpstn_cd
and a.jtit_cd = b.jtit_cd
) a
where use_flg = '1'
and emp_num not in ( select nonappraiser
from bdap102t
where vlt_year = '2005'
and sequ_cd = '1'
and exld_clss_cd != ''
)
) a, bdap012t b
where a.emp_num = b.nonappraiser
and a.prgs_stts < '07'
and a.prgs_stts in ('03', '04', '05') //목표완료, 1차목표협의, 2차목표협의
and b.vlt_year = '2006'
and b.sequ_cd = '1'
and b.appraiser is not null
) a
) a, hmpa001m b
where a.to_id = b.emp_num
) a
group by to_id, to_nm

 

ㅋㅋ 넘 길당..

이 글에 대한 댓글이 총 1건 있습니다.

죄송합니다. 사이베이스에서 인라인뷰가 되나요....?

지나가다가님이 2006-03-21 13:43에 작성한 댓글입니다. Edit
[Top]
No.
제목
작성자
작성일
조회
1466AutoCommit에 대해서질문 [1]
이병진
2006-03-22
3666
1465load 사용시 " 처리 [2]
박철
2006-03-21
3708
1464' ' 문자열 넣을때 주위해야 할것들 [1]
한원
2006-03-21
4053
1463이주환님~ DB Queyr한번 봐주세요 [1]
sony
2006-03-20
3509
1462트랜잭션 로그의 처리 [2]
시가있는풍경
2006-03-20
4928
1461sybase db 를 설치하려면 뭐를 다운받아야 하나요 ? [1]
이성윤
2006-03-17
4045
1460도와주세요 [3]
김남형
2006-03-16
3384
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.017초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다