gpt4 book ai didi

mysql - 以下 mysql 语句的 groupby 替代方案

转载 作者:行者123 更新时间:2023-11-29 16:15:46 31 4
gpt4 key购买 nike

我有一个如下的数据库语句。如何在不使用group by的情况下重写以下数据库语句我主要使用groupBy来从tenantproperty中删除重复的数据,并且租户实体

select * 
from app_mapping map
where map.org = 'organization1' and map.entity = 'ALERT' and map.app_id = 66 and
map.mode = 'TENANT'
GROUP BY map.tenantproperty, map.tenantentity;

最佳答案

通常的做法如下:

SELECT DISTINCT columns
, I
, actually
, want
FROM my_table

关于mysql - 以下 mysql 语句的 groupby 替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54807290/

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