- Today
- Total
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 티스토리챌린지
- substr
- 오블완
- struct
- SWIFT
- 딥러닝
- Observable
- Python
- tapply
- ios
- scheduledTimer
- swiftUI
- 명령어
- 시각화
- MVC
- rest api
- ReLU
- cocoapods
- Optional
- barplot
- sigmoid
- r
- Request
- deeplearning
- decode
- rxswift
- HTTP
- Linux
- SQL
- 연산자
목록decode (3)
iOS 개발 기록 블로그

func performRequest(urlString: String) { //1. Create a URL if let url = URL(string: urlString) { //2. Create a URLSession let session = URLSession(configuration: .default) //3. Give URLSession a task let task = session.dataTask(with: url) { data, response, error in if error != nil { print(error!) return// 에러가 있으면 스톱 } if let safeData = data { // safeData를 String 형태로 변환 } } //4. Start the task ta..

nvl SQL(오라클)의 nvl 함수를 파이썬으로 구현해보겠습니다. SQL 예시로 아래와 같습니다. SELECT ename, nvl(comm, 0) FROM emp; emp라는 테이블에서 comm(커미션)이 null인 사원은 0으로 null이 아니면 comm을 출력하는 문장입니다. Python으로 구현해보면 def nvl(val1, val2): if val1 is "": return val2 return val1 import csv f = open("emp_comm.csv 테이블이 있는 경로", "r") emp_csv = csv.reader(f) for emp in emp_csv: print(emp[1], nvl(emp[6], 0)) #emp[6]은 comm이 있는 열 위와 같이 작성할 수 있습니다. d..

nvl2 위와 같은 데이터 테이블이 있다고 생각해봅시다. 예제) SELECT ename, sal, comm, nvl2(comm, sal+comm, sal) FROM emp; 설명) nvl2를 자세히 보면 comm(커미션)이 null이면 sal+comm이, null이 아니면 sal이 출력되도록 하는 함수입니다. decode 예시) SELECT ename, sal, deptno, decode(deptno, 10, 6000, 20, 3400, 0) 보너스 FROM emp; 설명) 사원번호(deptno)가 10이면 6000을, 20이면 3400을 보너스라는 컬럼명으로 해서 출력하라는 의미입니다. case decode는 등호(같다는) 비교만 가능합니다. 그러나 case는 보통의 프로그래밍 언어의 if else와 ..