Skip to content

Commit da21f4b

Browse files
committed
Improve MCC query
1 parent bef9938 commit da21f4b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
SELECT
22

3-
d1.Id,
4-
d1.litterId,
3+
d1.Id,
4+
d1.litterId,
55

6-
GROUP_CONCAT(distinct d2.Id, ',') as litterMates
6+
(SELECT GROUP_CONCAT(distinct d2.Id, ',') as litterMates FROM study.Demographics d2 WHERE d2.qcstate.publicdata = true AND d1.litterId = d2.litterId AND d1.id != d2.id) as litterMates
77

88
FROM study.Demographics d1
99

10-
JOIN study.Demographics d2 ON (d1.litterId = d2.litterId AND d1.id != d2.id)
11-
12-
WHERE
13-
d1.qcstate.publicdata = true AND
14-
d2.qcstate.publicdata = true
15-
16-
GROUP BY d1.Id, d1.litterId
10+
WHERE d1.qcstate.publicdata = true

0 commit comments

Comments
 (0)