0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SQLiteのあれこれ

Posted at

SQLiteで列区切文字列に『Tab』を指定する場合。※下記は変数に代入する例
SEPARATOR=$(echo -e '\t')

上記の変数を使い、CSVデータをSQLiteコマンド(SQLite3コマンド)でインポートする例
./sqlite3 -separator $SEPARATOR {database_name} ".import /home/hoge/hoge.csv {table_name}"

下記はEXCEPT演算子でデータの差分件数を比較する例
select count(*) from (select * from {table_name1} except select * from {table_name2});
※EXCEPT演算子は左側(table_name1)に対して右側(table_name2)を比較し、差分を抽出する。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?