select id+','+DISPLAY_TO as details from n_note where id=123456;
我與下面的錯誤味精結束了合併獲得無效的數字錯誤,而使用別名,我的成績在SQL
"ORA-01722: invalid number"
我用sqlplus
select id+','+DISPLAY_TO as details from n_note where id=123456;
我與下面的錯誤味精結束了合併獲得無效的數字錯誤,而使用別名,我的成績在SQL
"ORA-01722: invalid number"
我用sqlplus
來連接字符串,你有使用串聯operator ||:
select id || ',' || DISPLAY_TO as details from n_note where id=123456;
比你的查詢中使用了錯誤的連接符其他(它應該是||
),你會得到這個錯誤原因;你想
select id+','+DISPLAY_TO
這裏,最有可能id
是數字列和DISPLAY_TO
是一個字符串列;並試圖連接它試圖將DISPLAY_TO
列轉換爲整數,並與該錯誤失敗。
如這裏Oracle/PLSQL: ORA-01722 Error
說你執行的嘗試將字符串轉換爲數字 SQL語句,但它是不成功的。
字段'id'和'DISPLAY_TO?'是什麼類型? – pythonian29033