我有日、版和活跃的桌子
In table I have the same days where active = 1 and active = 0 I need to get from the database all these days, where active = 1 and where version_id is max. For this purpose I wrote the following query:
SELECT MAX(version_id) ,DAY, active FROM `day` group by day, active
但第28和第29天是重复的, 所以当我使用“ 和活动=0” 时, 它显示我使用活动=1( 和低MAX( VERSION_ ID)) 的 第28天是 28天, 但不应该看到那一天 。