-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
mcc/resources/queries/study/demographicsLittermates.query.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<query xmlns="http://labkey.org/data/xml/query"> | ||
<description>Littermates of Any Animal</description> | ||
<metadata> | ||
<tables xmlns="http://labkey.org/data/xml"> | ||
<table tableName="demographicsLittermates" tableDbType="NOT_IN_DB"> | ||
<description>Littermates of Any Animal</description> | ||
<columns> | ||
<column columnName="Id"> | ||
<isKeyField>true</isKeyField> | ||
<isHidden>true</isHidden> | ||
</column> | ||
<column columnName="litterId"> | ||
|
||
</column> | ||
<column columnName="litterMates"> | ||
<columnTitle>Littermate(s)</columnTitle> | ||
</column> | ||
</columns> | ||
<titleColumn>Relationship</titleColumn> | ||
</table> | ||
</tables> | ||
</metadata> | ||
</query> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SELECT | ||
|
||
d1.Id, | ||
d1.litterId, | ||
|
||
GROUP_CONCAT(d2.Id, ',') as litterMates, | ||
|
||
FROM study.Demographics d1 | ||
|
||
JOIN study.Demographics d2 ON (d1.litterId = d2.litterId AND d1.id != d2.id) | ||
|
||
WHERE | ||
d1.qcstate.publicdata = true AND | ||
d2.qcstate.publicdata = true | ||
|
||
GROUP BY d1.Id, d1.litterId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters