MySQL use the select statement to query the specified table in the specified column (field) within the time specified row of data

To review the syntax of the SQL statement select statement:

Select the basic syntax of the statement:

Select <列的集合> from <表名> where <条件> order by <排序字段和方式>

If you want to query all the data specified column in a table, the query can be written:

select a column name, column name 2, column names 3 ... from <table name>

To illustrate one behind this statement can still use the where clause, the specified column is used to select the specified line. This allows more accurate query results need to.

Look at an example

SELECT * FROM tc_device_datas Where deviceid = '180601005' AND (addtime between '2018-06-07' AND '2018-06-09')

If the first and second conditions are true, the AND operator displays a record.

Reproduced in: https: //my.oschina.net/rhymo/blog/1842808

Guess you like

Origin blog.csdn.net/weixin_33796177/article/details/91700215