컬럼명이 예약어일 때 처리 방법

Hyunwoo Seo·2022년 9월 11일
0

MySQL

목록 보기
4/5
post-thumbnail

컬럼명이 예약어일 때,


1. 컬럼이름 고치기


2. 백틱(single quotation) 사용하기

SELECT A, B, key from table; // ERROR
SELECT A, B, `key` from table; // OK

node 백엔드 쿼리 사용할 때,

`SELECT A, B, `key` from table;` // ERROR
`SELECT A, B, \`key\` from table;` // OK

0개의 댓글