SQL Commands: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 5: | Line 5: | ||
| yyyymmdd to yyyy-mm-dd | | yyyymmdd to yyyy-mm-dd | ||
| | | | ||
< | <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'; | ||
</ | </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';
|