Sqlite3 初年度からの経過日数を求めるサンプル

環境
Windows11 pro 64bit
sqlite 3.37.1

構文
strftime('%j’,日付)
初年度からの経過日数を求めるには、「strftime」で「%j」を使用します。

使用例
テーブル「usertbl」というテーブルを使用して初年度からの経過日数を求めます。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
select
created_date,
strftime('%j', created_date)
FROM usertbl;
select created_date, strftime('%j', created_date) FROM usertbl;
select
created_date,
strftime('%j', created_date)
FROM usertbl;

 

IT

Posted by arkgame