본문 바로가기
데이터베이스/SQLite

sqlite 팁 TIP

by MonoSoft 2023. 3. 3.
728x90
반응형

sqlite 팁 TIP

 

 

Sqlite 다중 중첩 case문

 

case [Su_Volt] when 1 then (case [Su_Kind] when 1 then '6600' 

when 2 then '440' end) 

when 2 then (case [Su_Kind] when 1 then '3300'

when 2 then '380' end) 

when 3 then (case [Su_Kind] when 2 then '220' end) end as Su_Volt,

 

 

 

expecting: LargeInt actual: WideString

 

TFDQuery and SQLite: Type mismatch for field, expecting: LargeInt actual: WideString

SELECT DayTime AS "TheDate", Sum(Device1) AS "DeviceTotal::BIGINT"

FROM HistoryRuntime WHERE DayTime BETWEEN {d 2017-06-01}

AND {d 2017-06-26} GROUP BY Date(DayTime)

 

 

isnull 같은 함수 

sql구문 : isnull(cash, 0) as cash

sqlite구문 : ifnull(cash, 0) as cash

 

 

728x90
반응형

댓글