SQL Commands: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
| yyyymmdd to yyyy-mm-dd
| yyyymmdd to yyyy-mm-dd
|
|
<source lang="sql">
<syntaxhighlight lang="sql">
SELECT printf('%s-%s-%s',
SELECT printf('%s-%s-%s',
   SUBSTR(trading_date,1,4),
   SUBSTR(trading_date,1,4),
Line 11: Line 11:
   SUBSTR(trading_date,7,2)
   SUBSTR(trading_date,7,2)
) FROM short_sell WHERE trading_date='20190605';
) FROM short_sell WHERE trading_date='20190605';
</source>
</syntaxhighlight>
|}
|}

Revision as of 07:31, 8 April 2025

SQLite 3

TODO Command
yyyymmdd to yyyy-mm-dd
SELECT printf('%s-%s-%s',
  SUBSTR(trading_date,1,4),
  SUBSTR(trading_date,5,2),
  SUBSTR(trading_date,7,2)
) FROM short_sell WHERE trading_date='20190605';