gpt4 book ai didi

sql - SQLite中如何检查一个值是否为数字

转载 作者:IT王子 更新时间:2023-10-29 06:21:03 24 4
gpt4 key购买 nike

我有一列包含数字和其他字符串值(如“?”、“???”等)

是否可以在 SQLite 的 where 子句中添加一个“is number”条件?像这样的东西:

select * from mytable where isnumber(mycolumn)

最佳答案

来自documentation ,

The typeof(X) function returns a string that indicates the datatype of the expression X: "null", "integer", "real", "text", or "blob".

您可以使用 where typeof(mycolumn) = "integer"

关于sql - SQLite中如何检查一个值是否为数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32528759/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com