当前位置:Gxlcms > 数据库问题 > Mysql、Oracle、SQL-Server 查询字段值长度

Mysql、Oracle、SQL-Server 查询字段值长度

时间:2021-07-01 10:21:17 帮助过:26人阅读

在不同的数据库中,如何查询字段值长度?Mysql、Oracle、SQL-Server 中提供了不同的函数方法。



示例:

-- 查询长度为11位的手机号
-- MySQL: length()
SELECT phone FROM address_book where length(phone) = 11;
-- Oracle: length()
SELECT phone FROM address_book where length(phone) = 11;
-- SQL Server: len()
SELECT phone FROM address_book where len(phone) = 11;

Mysql、Oracle、SQL-Server 查询字段值长度

标签:rom   add   sel   sql   不同   pre   rac   class   ddr   

人气教程排行