0

我正在使用set colsep'|' 在 sqlplus 中。但是,它仅在两列之间而不是在列的开头和结尾处附加管道(|)列运算符。示例 - 它给出这样的输出 - emp_name|emp_department|emp_salary

我想要这样的输出(附加“|”)在开头和结尾:|emp_name|emp_department|emp_salary| 我如何使用 sqlplus 在 oracle 中实现这一点,请。帮帮我...你的早期反应可以缓解我的神经!!!

4

2 回答 2

4

我不认为 sqlplus 让你这样做。如您所知,分隔列在这里是为了,好吧.. 分隔两列。你总是可以这样做你的要求:

select '|' || col1, col2, col3, col4 || '|'
from myTable
于 2009-07-02T10:21:44.203 回答
0
select
   NULL,               -- select your left most |
   your_first_column,
   another_column_1,
   another_column_2,
   your_last_column,
   NULL                -- select right mose |
 from
   your_table;
于 2013-08-20T13:08:16.637 回答