SQL 练习

1One or the other (but not both) 异或逻辑运算

select name ,population ,area from world
where (case when population>250000000 then
 area<3000000 else area>3000000 end)  

2ROUND 小数位

ROUND(gdp/population,2) 两位小数

ROUND(gdp/population,-3)  靠近1000 Round this value to the nearest 1000.

3包含字符个数

LENGTH(name) - LENGTH(REPLACE(name,'a',''))=1 包含a等于 1

猜你喜欢

转载自www.cnblogs.com/lan-meng/p/8981194.html