gpt4 book ai didi

5.6.17_1 的 MySQL 语法错误

转载 作者:行者123 更新时间:2023-11-29 08:01:26 24 4
gpt4 key购买 nike

我有 MySQL 5.6.17_1 并具有用于 5.1.xx 的查询

select
schtermid,idfptnsubid,d.idfptnid,idflinksetid,
cast(count(distinct cthr) as real)/cast(count(distinct s.schid) as real)*100 as ctr, cast(sum(status) as real)/cast(count(*) as real)*100 as pfiled,
count(distinct s.schid) as schcount
from source.kdm_session as

这提示

您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解要在附近使用的正确语法

'real)/cast(count(distinct s.schid)  as real)*100  as ctr, cast(sum(status) as' at line 3

哪一部分是错误的?我应该改变什么才能发生同样的事情?

最佳答案

per the docs , real 不是有效类型:

The type for the result can be one of the following values:

BINARY[(N)]
CHAR[(N)]
DATE
DATETIME
DECIMAL[(M[,D])]
SIGNED [INTEGER]
TIME
UNSIGNED [INTEGER]

关于5.6.17_1 的 MySQL 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23703166/

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