By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version() |
---|
10.9.2-MariaDB-1:10.9.2+maria~deb11 |
Records: 8 Duplicates: 0 Warnings: 0
Records: 0 Duplicates: 0 Warnings: 0
Records: 8 Duplicates: 0 Warnings: 0
Table | Create Table |
---|---|
end_day_quotes_AVG | CREATE TABLE `end_day_quotes_AVG` ( `id` int(11) NOT NULL AUTO_INCREMENT, `quote_date` date NOT NULL, `bid` decimal(15,5) NOT NULL, `stock_id` int(11) DEFAULT NULL, `etf_id` int(11) DEFAULT NULL, `crypto_id` int(11) DEFAULT NULL, `certificate_id` int(11) DEFAULT NULL, `currency_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `currency_stock_date` (`currency_id`,`stock_id`,`quote_date`) ) ENGINE=InnoDB AUTO_INCREMENT=10570526 DEFAULT CHARSET=utf8mb4 |
id | quote_date | bid | stock_id | etf_id | crypto_id | certificate_id | currency_id |
---|---|---|---|---|---|---|---|
10537508 | 2023-01-01 | 7.54444 | 40396 | null | null | null | 2 |
10537509 | 2023-01-01 | 8.38013 | 40400 | null | null | null | 2 |
10537510 | 2023-01-01 | 2.66786 | 40569 | null | null | null | 2 |
10537511 | 2023-01-01 | 15.48286 | 40581 | null | null | null | 2 |
10537512 | 2023-01-02 | 8.54444 | 40396 | null | null | null | 2 |
10537513 | 2023-01-02 | 9.38013 | 40400 | null | null | null | 2 |
10537514 | 2023-01-02 | 3.66786 | 40569 | null | null | null | 2 |
10537515 | 2023-01-02 | 16.48286 | 40581 | null | null | null | 2 |
when | currency_id | stock_id | quote_date | bid |
---|---|---|---|---|
last | 2 | 40396 | 2023-01-02 | 8.54444 |
last | 2 | 40400 | 2023-01-02 | 9.38013 |
last | 2 | 40569 | 2023-01-02 | 3.66786 |
last | 2 | 40581 | 2023-01-02 | 16.48286 |
next-to-last | 2 | 40396 | 2023-01-01 | 7.54444 |
next-to-last | 2 | 40400 | 2023-01-01 | 8.38013 |
next-to-last | 2 | 40569 | 2023-01-01 | 2.66786 |
next-to-last | 2 | 40581 | 2023-01-01 | 15.48286 |