1、首先定義一個sql標簽,一定要定義唯一id。(name,age是要查詢的字段)
<sql id="Base_Column_List" >name,age</sql>
2、然后通過id引用
<select id="selectAll">
select
<include refid="Base_Column_List" />
from student
</select>
這個<include refid="Base_Column_List" />會自動把上面的代碼貼過來。
1、首先定義一個sql標簽,一定要定義唯一id。(name,age是要查詢的字段)
<sql id="Base_Column_List" >name,age</sql>
2、然后通過id引用
<select id="selectAll">
select
<include refid="Base_Column_List" />
from student
</select>
這個<include refid="Base_Column_List" />會自動把上面的代碼貼過來。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。