1, MySQL simple query: Select field 1, Field 2 ... from TableName;
If a field writes A *, which represents all fields of the query, it is equivalent to specifying all the field names, so if you want to query data for all fields, it is generally used *.
2, go to re-query: SELECT DISTINCT field 1, Field 2 ... form tablename;
Can be compared with the results of the previous picture.
3, directly in the query to do mathematical arithmetic, subtraction Yu:
4. Rename the query result field when querying; Select field 1 as Name 1, field 2 as Name 2 ... from TableName;
Here the as rename is used, in fact as can be omitted without writing:
5. Use the Concat connection string to get a custom formatted query result:
6, suddenly think of the library and the table before the deletion and change operation but missed the operation of the query, here: Query all the database show databases; query all tables under the current database show tables;
MySQL Common basic operation Syntax (iv)--simple unconditional query on data and library and table query "command line mode"