2012-11-30 4 views
2

빈 열을 만들고 싶습니다. 나는이값이없는 테이블 끝에 빈 열을 만드는 방법

select LOSA_APP.app_ref_no AS "App.Ref.No.", 
    CODE_BRANCH.branch_name AS "Business Unit", 
    CODE_STAFF.staff_name AS "RM", 
    to_date(:endDate, 'dd.mm.yyyy') - LOSA_APP_Z.li_dt AS "Day Count", 
    ..., 
    (select "RemarK By SDS" from dual) 
from 
    losa_app LOSA_APP 
INNER JOIN 
    code_branch CODE_BRANCH 
ON 
    LOSA_APP.attend_branch = CODE_BRANCH.branch_id 
.... 
where 
    LOSA_APP.app_status='A'; -- Application Status in {‘accepted’} 

을 시도하지만 난

ORA-00904: "RemarK By SDS": invalid identifier 
00904. 00000 - "%s: invalid identifier" 
*Cause:  
*Action: 
Error at Line: 22 Column: 16 

라인 (22)가 (select "RemarK By SDS" from dual) 것을 오류를 얻고있다. 사실 나는 비고를 위해이 빈 열을 끝에 추가하려고합니다. 이 열에는 값이 없습니다.

감사

답변

2

시도 :

select LOSA_APP.app_ref_no AS "App.Ref.No.", 
    CODE_BRANCH.branch_name AS "Business Unit", 
    CODE_STAFF.staff_name AS "RM", 
    to_date(:endDate, 'dd.mm.yyyy') - LOSA_APP_Z.li_dt AS "Day Count", 
    ..., 
    '' as "RemarK By SDS" 
from 
    losa_app LOSA_APP 
..... 

대신 (select "RemarK By SDS" from dual) 사용 단지 '' as "RemarK By SDS"는 결과 집합의 끝에서 당신에게 빈 열을 제공합니다.

관련 문제