The date of temperature
10.20 10-20
10.21 10-15
I type 17 can return to the following content of this article
The date of temperature
10.20 10-20
Could you tell me how to write thank you want to achieve this effect SQL statements
CodePudding user response:
Suggested that the temperature of the column apart into two maximum temperature and minimum temperature field, so you need to determine x> The lowest temperature and xCodePudding user response:
A little research, found there is a solution
SELECT * FROM T
WHERE CAST (SUBSTRING_INDEX (` ` temperature, '-', 1) AS SIGNED INTEGER) & lt; 17
AND CAST (SUBSTRING_INDEX (` ` temperature, '-', 1) AS SIGNED INTEGER) & gt; 17
CodePudding user response:
SELECT*
The FROM
T
WHERE 17 BETWEEN CAST (
SUBSTRING_INDEX (' temperature ', '-', 1) AS SIGNED INTEGER
)
AND CAST (
SUBSTRING_INDEX (' temperature ', '-', 1) AS SIGNED INTEGER
);