work on order by began
This commit is contained in:
50
main.cpp
50
main.cpp
@@ -9,7 +9,7 @@ int main(int argc, char *argv[]) {
|
||||
std::vector<std::string> sql_commands{
|
||||
"create table a (i integer not null, s varchar(64), f float null)",
|
||||
"insert into a (i, s) values(1, upper('one'))",
|
||||
"update table a set s = 'null string aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'",
|
||||
// "update table a set s = 'null string aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'",
|
||||
// "update table a set i = null",
|
||||
"insert into a (i, s) values(2, 'two')",
|
||||
"insert into a (i, s) values(3, 'two')",
|
||||
@@ -17,30 +17,30 @@ int main(int argc, char *argv[]) {
|
||||
"insert into a (i, s) values(5, 'five')",
|
||||
"insert into a (i, s) values(to_date('20.12.1973', '%d.%m.%Y'), 'six')",
|
||||
"save table a into '/tmp/a.csv'",
|
||||
"select i, s from a where i > 2",
|
||||
"select i, s from a where i = 1",
|
||||
"select i, s from a where s = 'two'",
|
||||
"select i, s from a where i <= 3 and s = 'one'",
|
||||
"select i, s from a where i > 0",
|
||||
"delete from a where i = 4",
|
||||
"select i, s from a where i > 0",
|
||||
"update a set f = 9.99 where i = 3",
|
||||
"select i, s, f from a where i = 3",
|
||||
"update a set s = 'three', f = f + 0.01 where i = 3",
|
||||
"select i, s, f from a where i = 3",
|
||||
"create table data (ticker varchar(8), price float null)",
|
||||
"load data from '/Users/vaclavt/Library/Mobile Documents/com~apple~CloudDocs/Development/usql/data.csv')",
|
||||
"select ticker, price from data",
|
||||
"select i, s, f from a where i < 300",
|
||||
"create table x as select i, s, f from a where i < 300",
|
||||
"select i, s, f from x where i < 300",
|
||||
"drop table x",
|
||||
"select i, s, f from a where i > 300",
|
||||
"select i, to_string(i, '%d.%m.%Y'), s, f from a where i > 300",
|
||||
"create table prices (datetime integer, symbol varchar(8), prev_close float, open float, price float, change float, change_prct varchar(16))",
|
||||
"load prices from '/Users/vaclavt/Library/Mobile Documents/com~apple~CloudDocs/Development/usql/prices.csv'",
|
||||
"insert into prices (datetime, symbol, prev_close, open, price, change, change_prct) values (1626979443, 'MPC', 54.08, 53.82, 53.63, -0.832101, '-0.83 %')",
|
||||
"select to_string(datetime, '%d.%m.%Y %H:%M:%S'), symbol, prev_close, open, price, change, change_prct from prices where symbol = 'SYF'"
|
||||
"select i, s from a where i > 2 order by 1 desc"
|
||||
// "select i, s from a where i = 1",
|
||||
// "select i, s from a where s = 'two'",
|
||||
// "select i, s from a where i <= 3 and s = 'one'",
|
||||
// "select i, s from a where i > 0",
|
||||
// "delete from a where i = 4",
|
||||
// "select i, s from a where i > 0",
|
||||
// "update a set f = 9.99 where i = 3",
|
||||
// "select i, s, f from a where i = 3",
|
||||
// "update a set s = 'three', f = f + 0.01 where i = 3",
|
||||
// "select i, s, f from a where i = 3",
|
||||
// "create table data (ticker varchar(8), price float null)",
|
||||
// "load data from '/Users/vaclavt/Library/Mobile Documents/com~apple~CloudDocs/Development/usql/data.csv')",
|
||||
// "select ticker, price from data",
|
||||
// "select i, s, f from a where i < 300",
|
||||
// "create table x as select i, s, f from a where i < 300",
|
||||
// "select i, s, f from x where i < 300",
|
||||
// "drop table x",
|
||||
// "select i, s, f from a where i > 300",
|
||||
// "select i, to_string(i, '%d.%m.%Y'), s, f from a where i > 300",
|
||||
// "create table prices (datetime integer, symbol varchar(8), prev_close float, open float, price float, change float, change_prct varchar(16))",
|
||||
// "load prices from '/Users/vaclavt/Library/Mobile Documents/com~apple~CloudDocs/Development/usql/prices.csv'",
|
||||
// "insert into prices (datetime, symbol, prev_close, open, price, change, change_prct) values (1626979443, 'MPC', 54.08, 53.82, 53.63, -0.832101, '-0.83 %')",
|
||||
// "select to_string(datetime, '%d.%m.%Y %H:%M:%S'), symbol, prev_close, open, price, change, change_prct from prices where symbol = 'SYF'"
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user