mysql 쿼리 에러 질문드립니다 0 2 1,135

by 메밀묵도토리묵 [SQL Query] mariadb dbeaver [2022.07.25 17:34:29]


UPDATE      tb_int_attendlist_spc set
      fixed_id = case when fixed_id = '0' then '부적합'
      when fixed_id = '1' then '적합'
      else ''
      end
    where attend_dt = '20220204'
    and emp_no = '10521608'

// mysql 쿼리를 위처럼 작성했는데,

error: (conn=61476, no: 1366, SQLState: 22007) Incorrect integer value: '적합' for column `db_mmap`.`tb_int_attendlist_spc`.`fixed_id` at row 1

// 이렇게 에러가 뜨는데, fixed_id 컬럼은 문자인데, 어떤 부분이 문제인지 모르겠습니다,

by pajama [2022.07.26 07:52:07]

set
      fixed_id = case when fixed_id = '0' then '부적합'
      when fixed_id = '1' then '적합'

 

fixed_id에 '부적합', '적합'을 입력하려해서 그런것 같네요.

 


by 신이만든지기 [2022.07.26 09:05:44]

fixed_id 가  int 형으로 만들어져 있는지 확인해보세요. 오류 메시지에는  int형으로 만들어져 있다고 나오네요.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입