SQL NULL Functions
SQL IFNULL(), ISNULL(), COALESCE(), NVL() Functions
null 값을 허용하고 싶을 때
MySQL
- IFNULL() 이용
SELECT ProductName, UnitPrice * (UnitsInStock + IFNULL(UnitsOnOrder, 0)) FROM Products;
- IFNULL() 이용
SQL server
- ISNULL()
SELECT ProductName, UnitPrice * (UnitsInSTock + ISNULL(UnitsOnOrder, 0))
FROM Products;
- MS 엑세스
- IsNULL()
- Oracle
- NVL()
'Computer Science > Database' 카테고리의 다른 글
W3Schools SQL | #35 SQL 주석 (0) | 2022.10.29 |
---|---|
W3Schools SQL | #34 SQL STORED PROCEDURES - SQL SERVER (0) | 2022.10.29 |
W3Schools SQL | #32 SQL CASE 문법 (0) | 2022.10.29 |
W3Schools SQL | #31 SQL INSERT INTO SELECT 구문 (0) | 2022.10.29 |
W3Schools SQL | #29 SQL ANY ALL 연산자 (0) | 2022.10.28 |