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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM