mysql 排除某個字段的sql語句


select concat('select ',group_concat(case when column_name in('id','hot') then null else column_name end),' from city;') from information_schema.columns where table_schema='email' and table_name='city';

以上得出來的是一個sql語句,排除了id,hot ,僅僅是得出了sql語句,然后再執行才會得到數據;其實這個看起來算是一個然並卵的東西,記錄一下知道有這么個東西。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM