MariaDB null과 빈값을 구분하여 비교(<=>, ifnull)
언제 사용하면 좋은가?2개의 테이블 데이터를 비교하면서 null과 ''을 구분해야 할 때 연산자 설명같으면 1, 다르면 0NULL vs NULL = 1NULL vs 값 = 0'' vs null = 0not (a.cust_cd b.cust_cd)같으면 1 → not이니깐 0 (안 걸림)not (a.cust_cd b.cust_cd and a.item_cd b.item_cd)cust_cd: 1, item_cd: 0 → AND는 0이 1개라도 있으면 0 → not이니깐 1 (걸림)풀어쓰면 (드모르간)not (a.cust_cd b.cust_cd) or not (a.item_cd b.item_cd)1개라도 다르면 1 → 걸린다쿼리SELECT a.ord_no FROM old_order a INNER JOIN..