やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

SQLite3構文 expression(cast)

 型変換。キャスト。

成果物

構文

cast(式 as 型名)

やってみる

integer

select cast('1' as integer);
1

real

select cast('1.2' as real);
1.2

text

select cast(x'41' as text);
A

blob

 これはできなかった。

select cast('A' as blob);
A
select cast(x'41' as blob);
A

対象環境

$ uname -a
Linux raspberrypi 4.19.42-v7+ #1218 SMP Tue May 14 00:48:17 BST 2019 armv7l GNU/Linux

前回まで