728x90
반응형
SMALL
1. Null과 ' ' 공백 데이터
select null;
select '';
. Null인 데이터 조회하기
1-1. null의 연산
select 100 + null;
select 100 + '';
결과: 100, 문자열 연산됨
2. Null 데이터 조회하기
select * from member;
✅ address1이 null값인 회원의 userid, username, hp 필드 조회
select userid, username, hp from member where address1 is null;
✅ address1이 null값이 아닌 회원의 userid, username, hp 필드 조회
select userid, username, hp from member where address1 is not null;
728x90
반응형
LIST
'DataBase > MySQL' 카테고리의 다른 글
[MySQL] 테이블에서 데이터 정렬하기 - ORDER BY절 (0) | 2023.03.16 |
---|---|
[MySQL] 원하는 조건에 만족하는 데이터만 조회하기 - WHERE절 (0) | 2023.03.16 |
[MySQL] 테이블 데이터 조회하기 - SELECT절, LIMIT (0) | 2023.03.16 |
[MySQL] SQL 연산자에 대해 알아보자! 🧐 (0) | 2023.03.16 |
[MySQL] member 테이블 예제 복습하기! 🤓 (1) | 2023.03.15 |