Home >Database >Mysql Tutorial >Commonly used basic operation syntax of mysql (4) - simple unconditional query of data and database and table query [command line mode]
1. Mysql simple query: select field 1, field 2... from tablename;
If you write a * in the field, it means querying all The field is equivalent to specifying all field names, so if you want to query the data of all fields, you generally use *.
2. Deduplication query: select distinct field 1, field 2... form tablename;
can be combined with the previous picture To compare the results.
3. Perform the four mathematical operations directly during query, including addition, subtraction, multiplication and division:
## Use as to rename here. In fact, as can be omitted:
5. Use concat Connect the string to get the query result in a custom format:
6. Suddenly I remembered that there were libraries and tables added before. The deletion operation misses the query operation. Here is the supplement:
Query all databases show databases;
Query all tables under the current database show tables;
The above is the content of mysql common basic operation syntax (4) - simple unconditional query of data and library and table query [command line mode]. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!