SQL Commands: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
(Created page with "== SQLite 3 == {| class="wikitable" ! TODO || Command |- | yyyymmdd to yyyy-mm-dd | SELECT printf('%s-%s-%s', SUBSTR(trading_date,1,4), SUBSTR(trading_date,5,2), SUBSTR(...")
 
Line 5: Line 5:
| yyyymmdd to yyyy-mm-dd
| yyyymmdd to yyyy-mm-dd
|
|
<source lang="sql">
SELECT printf('%s-%s-%s',
SELECT printf('%s-%s-%s',
   SUBSTR(trading_date,1,4),
   SUBSTR(trading_date,1,4),
Line 10: 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>
|}
|}

Revision as of 01:57, 10 June 2019

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';