반응형
250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Flux
- IntelliJ
- java bigdecimal
- or some instances in your deployment group are experiencing problems.
- 도커
- chartjs
- JavaScript
- Jenkins
- PostgreSQL
- codedeploy
- SQL
- COALESCE
- bootstrap
- Kafka
- docker
- node
- Airflow
- codebuild
- Spring Error
- kubeflow
- redis
- codedeploy error
- aws cicd
- AWS CI/CD 구축하기
- aws
- Spring
- Python
- chart.js
- codepipeline
- VPN
Archives
- Today
- Total
Small Asteroid Blog
[MySQL] 데이터 null 을 0 으로 본문
728x90
DB 데이터 조회 시 null 인 값을 0으로 변환하고자 한다.
조회할 때만 null 을 0으로 바꾸는 방법이다.
select COALESCE(h.point, 0) from history h ;
실제 DB에 데이터를 null 을 0으로 수정하는 방법이다.
update history set refund_point = 0 where refund_point is null;
728x90
반응형
'백엔드 > DB' 카테고리의 다른 글
[MySQL] 문자열 일부분만 가져오기 (0) | 2023.04.14 |
---|---|
[MySQL] MySQL에 csv 파일 INSERT 하기 (0) | 2023.03.21 |
[sql] functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (0) | 2023.01.04 |
[mysql] Failed to determine a suitable driver class (0) | 2022.11.08 |
MySQL EXPLAIN 실행 계획 보기 (쿼리 최적화 하기) (0) | 2022.08.19 |