Browse Source

用distinct代替 group by

xyxie 6 months ago
parent
commit
32488ef411
1 changed files with 1 additions and 2 deletions
  1. 1 2
      models/data_manage/edb_info.go

+ 1 - 2
models/data_manage/edb_info.go

@@ -806,10 +806,9 @@ func GetEdbInfoAllCalculateByEdbInfoIdList(edbInfoIdList []int) (list []*EdbInfo
 		return
 	}
 
-	sql := ` SELECT b.* FROM edb_info_calculate_mapping AS a
+	sql := ` SELECT DISTINCT b.* FROM edb_info_calculate_mapping AS a
 			 INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
              WHERE a.from_edb_info_id in (` + utils.GetOrmInReplace(num) + `)
-			 GROUP BY a.edb_info_id
 			 ORDER BY a.edb_info_id ASC `
 	err = global.DmSQL["data"].Raw(sql, edbInfoIdList).Scan(&list).Error