Commit 39e1b310 authored by Savorboard's avatar Savorboard

fix postgre sql bug.

parent cfb77aba
...@@ -164,14 +164,13 @@ select count(""Id"") from ""{0}"".""received"" where ""StatusName"" in (N'Proce ...@@ -164,14 +164,13 @@ select count(""Id"") from ""{0}"".""received"" where ""StatusName"" in (N'Proce
string statusName, string statusName,
IDictionary<string, DateTime> keyMaps) IDictionary<string, DateTime> keyMaps)
{ {
//SQL Server 2012+
var sqlQuery = var sqlQuery =
$@" $@"
with aggr as ( with aggr as (
select to_char(""Added"",'yyyy-MM-dd-HH') as ""Key"", select to_char(""Added"",'yyyy-MM-dd-HH') as ""Key"",
count(""Id"") as ""Count"" count(""Id"") as ""Count""
from ""{_options.Schema}"".""{tableName}"" from ""{_options.Schema}"".""{tableName}""
where ""StatusName"" = N'Processing' where ""StatusName"" = @statusName
group by to_char(""Added"", 'yyyy-MM-dd-HH') group by to_char(""Added"", 'yyyy-MM-dd-HH')
) )
select ""Key"",""Count"" from aggr where ""Key""= Any(@keys);"; select ""Key"",""Count"" from aggr where ""Key""= Any(@keys);";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment