Skip to content

Instantly share code, notes, and snippets.

@spinningcat
Created December 22, 2018 16:30
Show Gist options
  • Save spinningcat/0c4415ba4d9f861051566b28114cdb9e to your computer and use it in GitHub Desktop.
Save spinningcat/0c4415ba4d9f861051566b28114cdb9e to your computer and use it in GitHub Desktop.
with cte1 AS
(select cd.HASTA_ADI, concat(cd .HASTA_ADI, ' ', cd.HASTA_SOYADI) as HASTAADISOYADI, case when min(md.MAP) >
min(md.NIMAP then min(md.MAP) else min(md.NIMAP) end as mapnimapvalue from MonitorData md inner join
ClientPatientDemograficData as cd on md.PID = cd.HASTA_ID where md.DateMonitor <= DATEADD(hour, -1, getdate())
AND md.DateMonitor >= DATEADD(day, -1, GETDATE()) group by cd.HASTA_ADI, cd.HASTA_SOYADI
) select cte1*, case when mapnimapvalue < 90 then 1 else 2 end as point from cte1;
error: [S0001][102] Incorrect syntax near ','.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment