Mysql-uxxx-pyyy
Use lottery;
Select COUNT (id) from mop_bet_order_history where Created_at < ' 2015-11-01 ';
Statistics mop_order_history number of data bars before 2015-11-01
COUNT (ID) Statistics Bar number
SELECT * from mop_bet_order_history where Created_at < ' 2015-11-01 ' to outfile '/data/tmp-2015-11.csv ' fields Termina Ted by ', ';
In the Mop_bet_order_history table, look for data before 2015-11-01 and export to the/data/tmp-2015-11.csv file, separating the data with ', '.
SELECT * from mop_bet_order_history where Created_at < ' 2015-11-01 ' and created_at > ' 2015-10-01 ' into outfile '/data /tmp-201510-11.csv ' fields terminated by ', ';
In the Mop_bet_order_history table, after 2015-10-01, the table before 2015-11-01 is exported to the/data/tmp-201510-11.csv file, and the data is separated by ', '.
where use and/or to specify multiple query conditions, such as SELECT * from student where sex= ' man ' and age-20;
Select Field1,field2. From Table1,table2. where Condition1 [and/or] condition2.
', ' separates tables that specify one or more queries;
and/or specify multiple query conditions at the same time;
MySQL queries and exports the specified data, select From,where,into outfile export, fields terminated by separate export data