您好,登錄后才能下訂單哦!
今天做bootstrap的treeview,要求輸入節點ID id,父節點ID pid,文本 text
但是執行的sql別名都是大寫,所以找了下orcl的別名如何小寫的問題
代碼如下:
SELECT T.FUN_ID "pid",T1.FUN_ID id,T1.FUN_NM text,T1.FUN_ID, T1.FUN_CD, T1.FUN_NM FROM T_SM_FUNCTIONS T, T_SM_FUNCTIONS T1 WHERE T.FUN_ID = T1.PAR_FUN_ID AND T.FUN_ID = '5' AND T1.FUN_ID <> '5'
別名加上雙引號即別名顯示為小寫
如果是在java中 則用轉義的方式,如下
String sql = "SELECT T.FUN_ID \"pid\",T1.FUN_ID \"id\",T1.FUN_NM \"text\",T1.FUN_ID, T1.FUN_CD, T1.FUN_NM" +" FROM T_SM_FUNCTIONS T, T_SM_FUNCTIONS T1" +" WHERE T.FUN_ID = T1.PAR_FUN_ID" +" AND T.FUN_ID = '"+funid+"'" +" AND T1.FUN_ID <> '"+funid+"'"; List<?> list = this.queryForList(sql); return list;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。