본문 바로가기
반응형

420003

[MySql] SQL Error [1248] [42000]: Every derived table must have its own alias SQL Error [1248] [42000]: Every derived table must have its own alias Alias 명칭이 없어서 나타나는 오류. 원인.서브쿼리에서 Alias를 지정하지 않아서 나타난 에러.MySql 공식 문서에서는 FROM 절의 모든 테이블에는 이름이 있어야 함.Alias는 필수이며, 고유한 이름을 가져야함. doc.https://dev.mysql.com/doc/refman/8.0/en/derived-tables.html 변경 전. SELECT GRADE , COUNT(GRADE) FROM ( SELECT CASE WHEN SALARY > 2000 THEN 'High' WHEN SALARY BETWEEN 1000 AND 2000 THEN 'Medium' WHEN SA.. 2020. 6. 3.
[MySql] SQL Error [1305] [42000]: FUNCTION TO_CHAR does not exist SQL Error [1305] [42000]: FUNCTION TO_CHAR does not exist 단순문법에러. 원인.MySql에서는 Oracle 문법인 TO_CHAR를 지원하지 않음. 조치.TO_CHAR를 DATE_FORMAR()로 변경 doc.https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format Format 형식.다양하게 존재한다.(아래) 문법.인자로 date, format을 받는다.(아래) DATE_FORMAT(date,format) 예제.현재날짜를 yyyy/MM/dd로 표현해보자.(아래) SELECT DATE_FORMAT(NOW(), '%Y/%m/%d') -> 2020/05/27 2020. 5. 27.
[MySql] SQL Error [1064] [42000]: You have an error in your SQL syntax SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', 단순 문법에러. 원인. 내용 중 right syntax to use near ', 20, 48, 96 해당 내용으로 쿼리 조회 해보니.(아래) INSERT INTO ( ... ) VALUES ( ... , , 20, 48, 96, ... ); , 사이 빈 값 확인. 조치. 해당 필드는 decimal인데 빈 값으로 설정되어 있어서 에러 발생. 2020. 5. 25.
반응형