Oracle查询字段结果加单引号以及其他内容

1.单纯加单引号:

select chr(39)||name||chr(39) from users ;
或者
select ''''||name||'''' from users ;

如果后面需要加逗号,写为:

select ''''||name||''',' from users ;

2.加其他内容

select 'alter table '||table_name||' allocate extent;' from user_tables

参考:https://www.cnblogs.com/tan80000/p/9953097.html

posted @ 2019-03-04 14:49  BestTarry  阅读(3849)  评论(0编辑  收藏  举报