簡體   English   中英

第2行的列'descr'的數據太長

[英]Data too long for column 'descr' at row 2

當我嘗試執行此sql語句時

update claim cl set search_field = (select  concat(cl.claim_description,' ', cl.legal_basis,' ',co.name) from contact co where cl.probable=1 and cl.search_field is null and co.id=cl.contact_id)

我在上面遇到錯誤,並且沒有名為descr列。 有一個名為claim_description列,但不是descr

有人提示嗎? 謝謝

代替在UPDATE語句中使用相關子查詢,請嘗試:

UPDATE claim cl, contact co
SET cl.search_field = CONCAT (cl.claim_description,' ',cl.legal_basis,' ',co.NAME)          
WHERE cl.probable = 1
    AND cl.search_field IS NULL
    AND co.id = cl.contact_id

感謝您的幫助,我為此找到了解決方案。 更新觸發是問題,它試圖更新太短的變量descr。 看起來刷牙確實有助於編程:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM