postgresql isnumeric

前端之家收集整理的这篇文章主要介绍了postgresql isnumeric前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

WITH test(x) AS ( VALUES (''),('.'),('.0'),('0.'),('0'),('1'),('123'),('123.456'),('abc'),('1..2'),('1.2.3.4'),('1x234'),('1.234e-5'))

SELECT x,x ~ '^([0-9]+[.]?[0-9]*|[.][0-9]+)$' AS isnumeric FROM test;

WITH test(x) AS ( VALUES (''),('1.2.3.4')) SELECT x,x ~ '^[0-9]*.?[0-9]*$' AS isnumeric FROM test;------下面才是正解
原文链接:https://www.f2er.com/postgresql/195560.html

猜你在找的Postgre SQL相关文章