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