Select * From table1select * From Table1 where ID> = 1 and ID <= 20 and ID in (1, 2, 4, 5, 6, 7, 8, 9) or (ID between 1 and 10) select * From table3 where t3date> = '2014-08-10 'select * From Table1 where ID is not null group by ID, t1name order by ID, t1nameselect sum (ID) from table1select count (*) from table1select * from (select. *, B. t2value from Table1 a left join Table2 B on. id = B. t2table1id) aselect. *, B. * From Table1 a left join Table2 B on. id = B. t2table1id/* shows all data in Table A and all data in Table B that meet the association conditions. If table B contains multiple rows that meet the conditions in Table A, all the rows in Table B are displayed, the displayed content of table A is the same. If a data entry in Table A is not associated with data in Table B, the column B corresponding to the record in the query result is null and empty */select. *, B. * From Table1 a right join Table2 B on. id = B. t2table1id/* displays all data in Table B and all data that meet the association conditions in table. If a piece of data in Table B is not associated with data in Table A, the query result shows that the column corresponding to Table A is null and empty */select. *, B. * From Table1 a inner join Table2 B on. id = B. t2table1id/* only display all data in table B of Table A corresponding to the other party */-- return the id value of the last inserted database select @ identity as ID; select last_insert_id () as ID; update table4 a left join table5 B on. table5_id = B. id set. name = Concat (. name, '.html ') Where B. id = 1; -- Concat (. name, '.html ') Concat () returns after two strings are connected -- batch insert into Table1 (ID, t1name) values (1, 'name1'), (2, 'name2'), (3, 'name3'); Create Table table6 as select. ID, B. name from table4 a left join table5 B on. table5_id = B. ID where B. id = 1; -- create a new table using the query results.