gpt4 book ai didi

mysql - FIND_IN_SET 与别名

转载 作者:行者123 更新时间:2023-11-29 09:53:07 25 4
gpt4 key购买 nike

我想获取用逗号分隔的特定日期,因此使用组联系人。我的查询如下

   select doc,group_concat(tab.days) as group_days FROM tab where doc='G9AoP58ENTOwGBqo' AND FIND_IN_SET('sun',group_days);

但没有收到错误。

    #1054 - Unknown column 'group_days' in 'where clause'

最佳答案

您可以尝试以下操作 - 使用 group_concat(tab.days) 作为 FIND_IN_SET() 函数的参数而不是别名

select * from
(
select doc,group_concat(tab.days) as group_days FROM tab
where doc='G9AoP58ENTOwGBqo'
group by doc
)A
where FIND_IN_SET('sun',group_days);

关于mysql - FIND_IN_SET 与别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54438096/

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