判断字段长度函数length
SELECT name,capital
FROM world
WHERE LENGTH(name)=LENGTH(capital)
求字串,注意分做字串和右字串
LEFT(ARG,LENGTH)、RIGHT(ARG,LENGTH)
LEFT、RIGHT函数返回ARG最左边、右边的LENGTH个字符串,ARG可以是CHAR或BINARY STRING。
SELECT name,capital
FROM world
WHERE LEFT(name,1)=LEFT(capital,1) and name!=capital
保留小数点ROUND() 语法
SELECT ROUND(column_name,count)
FROM table_name
column_name字段,保留count个小数个数