case(2)
-
[DB] NULL, CASE, ESCAPE
1. NULL DBMS에서 null는 "값을 알 수 없음"을 의미한다. 가. IS NULL null는 "값을 알 수 없음"을 의미한다. select * from ta where can_be_null = null; 그래서 다음과 같은 방식으로 null인 row를 찾을 수 없다. select * from ta where can_be_null is null; null 값을 찾고 싶다면 = null이 아닌 is null 을 사용할 것. select * from ta where can_be_null is not null; is not null도 가능한다. 나. IFNULL() select IFNULL(can_be_null, 0) from ta; IFNULL(can_be_null, 0) : can_be_null가 ..
2024.04.14 -
2022-04-22 Shell_script_4
IF #!/bin/bash read -p "enter income amount" Income read -p "enter expenses aount" Expense let Net=$Income-$Expense if [ "$Net" -eq "0" ] then echo "Income and expences are equal" elif [ "$Net" -gt "0" ] then echo "profit : " $Net else echo "Loss : " $Net fi CASE case word in pattern1) command-list1 ;; pattern2) command-list2 ;; patternN) command-listN ;; esac checked against word for match may ..
2022.04.22