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). 其实我只是想在最后添加这个空列以供备注。此列不包含任何值。

谢谢

4

1 回答 1

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"它,它会在结果集的末尾为您提供空列。

于 2012-11-30T07:43:27.997 回答