SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE IF NOT EXISTS coins( dt VARCHAR(16), avg_price NUMERIC, tx_cnt NUMERIC, tx_vol NUMERIC, active_addr_cnt NUMERIC, symbol VARCHAR(8), full_nm VARCHAR(128), open_price NUMERIC, high_price NUMERIC, low_price NUMERIC, close_price NUMERIC, vol NUMERIC, market NUMERIC ); INSERT INTO coins (dt, avg_price, tx_cnt, tx_vol, active_addr_cnt, symbol, full_nm, open_price, high_price, low_price, close_price, vol, market) VALUES ('2013-04-28',135.3,41702.0,68798683.4463,117984.0,'BTC','Bitcoin',135.3,135.98,132.1,134.21,0.0,1500520000.0), ('2013-04-28',4.3,9174.0,44319520.0666,17216.0,'LTC','Litecoin',4.3,4.4,4.18,4.35,0.0,73773400.0), ('2013-04-29',134.44,51602.0,113812845.38,86925.0,'BTC','Bitcoin',134.44,147.49,134.0,144.54,0.0,1491160000.0), ('2013-04-29',4.37,9275.0,36478096.6026,18395.0,'LTC','Litecoin',4.37,4.57,4.23,4.38,0.0,74952700.0), ('2013-04-30',144.0,47450.0,84266323.8547,76871.0,'BTC','Bitcoin',144.0,146.93,134.05,139.0,0.0,1597780000.0), ('2013-04-30',4.4,9099.0,40391660.1041,17810.0,'LTC','Litecoin',4.4,4.57,4.17,4.3,0.0,75726800.0), ('2013-05-01',139.0,55176.0,120682532.517,83564.0,'BTC','Bitcoin',139.0,139.89,107.72,116.99,0.0,1542820000.0), ('2013-05-01',4.29,8990.0,76374202.7997,16991.0,'LTC','Litecoin',4.29,4.36,3.52,3.8,0.0,73901200.0), ('2013-05-02',116.38,55295.0,93375328.6292,81920.0,'BTC','Bitcoin',116.38,125.6,92.28,105.21,0.0,1292190000.0), ('2013-05-02',3.78,8031.0,11631506.3398,15769.0,'LTC','Litecoin',3.78,4.04,3.01,3.37,0.0,65242700.0), ('2013-05-03',106.25,51275.0,72731326.2283,82804.0,'BTC','Bitcoin',106.25,108.13,79.1,97.75,0.0,1180070000.0), ('2013-05-03',3.39,6280.0,4632241.48783,12956.0,'LTC','Litecoin',3.39,3.45,2.4,3.04,0.0,58607400.0), ('2013-05-04',98.1,50102.0,38965697.5445,69959.0,'BTC','Bitcoin',98.1,115.0,92.5,112.5,0.0,1089890000.0), ('2013-05-04',3.03,6168.0,5725030.20416,12377.0,'LTC','Litecoin',3.03,3.64,2.9,3.48,0.0,52476400.0), ('2013-05-05',112.9,50167.0,57083710.5451,72103.0,'BTC','Bitcoin',112.9,118.8,107.14,115.91,0.0,1254760000.0), ('2013-05-05',3.49,5948.0,6579465.33848,12245.0,'LTC','Litecoin',3.49,3.69,3.35,3.59,0.0,60525000.0); SELECT UPPER(full_nm) as full_name, dt, high_price as price FROM coins GROUP BY full_nm HAVING high_price = MAX(high_price) ORDER BY price DESC, full_name DESC, dt ASC;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear