gpt4 book ai didi

mySQL 返回每个字段的特定行

转载 作者:行者123 更新时间:2023-11-29 05:58:34 24 4
gpt4 key购买 nike

我将尽力解释这一点……我希望为每个字段返回 5 个随机行。例如,我有:

SELECT "Name","Ticket ID","Channel"
FROM Tickets
WHERE "Ticket Created at" between date('2017-09-01') AND date('2017-10-01')
AND "Channel" = 'Phone' or 'Chat' or 'Email'
AND "First Agent Primary Email" = 'abc.def@mail.com'

我想要做的是让表格为每个电话 channel 、每个聊天 channel 或每个电子邮件 channel 返回 5 个随机工单 ID。

有人能帮忙吗?

最佳答案

试试这个查询。

SELECT Name,Ticket ID,Channel FROM Tickets
WHERE Ticket Created at between date('2017-09-01')
AND date('2017-10
01')
AND Channel IN ( 'Phone', 'Chat' , 'Email')
AND First Agent Primary Email = 'abc.def@mail.com'
ORDER BY RAND() LIMIT 5;

关于mySQL 返回每个字段的特定行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47137630/

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