Skip to content

Commit 65e4a63

Browse files
authored
1. fixed issue where the milliseconds differ in the modified time causing pivoted rows to be displayed on mulitiple lines. (#887)
2. updated query source to match database view used on the production server.
1 parent 20cffb6 commit 65e4a63

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
SELECT
22
b.Id,
3+
b.modified,
34
b.Haplotype,
45
b.Ocid,
56
b.DataFileSource,
6-
b.modified,
77
group_concat(b.MhcValue) as MhcValue
88

9+
910
FROM (
1011
SELECT
1112
b.Id,
1213
b.Haplotype,
1314
b.Ocid,
1415
b.MhcValue,
1516
b.DataFileSource,
16-
b.Modified
17+
cast(b.modified as varchar) as modified
1718
FROM snprc_ehr.MhcData as b
18-
) as b
19+
) as b
1920

2021
GROUP BY b.id, b.ocid, b.DataFileSource, b.haplotype, b.modified
2122

22-
PIVOT MhcValue BY Haplotype IN
23-
(select distinct Haplotype from snprc_ehr.MhcData order by Haplotype
24-
25-
)
23+
PIVOT MhcValue BY Haplotype IN
24+
(
25+
select distinct Haplotype from snprc_ehr.MhcData order by Haplotype
26+
)

snprc_ehr/resources/source_queries/create_v_MchStatus.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SELECT m.[Animal ID] AS id ,
4444

4545
FROM dbo.MhcStatus AS m -- select primates only from the TxBiomed colony
4646
INNER JOIN labkey_etl.V_DEMOGRAPHICS AS d ON d.id = RIGHT(SPACE(6) + m.[Animal ID], 6)
47-
WHERE [A001 Status] IS NOT NULL AND [B008 Status] IS NOT NULL AND [B017 Status] IS NOT NULL AND [B003 Status] IS NOT NULL
47+
WHERE [A001 Status] IS NOT NULL OR [B008 Status] IS NOT NULL OR [B017 Status] IS NOT NULL OR [B003 Status] IS NOT NULL
4848

4949
GO
5050

0 commit comments

Comments
 (0)