From f58f92c8ad9757d319c47377e203ecec74038c4c Mon Sep 17 00:00:00 2001 From: Vitalii Fedorchenko Date: Sun, 8 Jan 2017 18:29:32 +0200 Subject: [PATCH] DbDataView: do not wrap select expressions with brackets (some databases like sqlite don't support this syntax) --- src/NReco.Data/DbDataView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NReco.Data/DbDataView.cs b/src/NReco.Data/DbDataView.cs index 2036926..9342e89 100644 --- a/src/NReco.Data/DbDataView.cs +++ b/src/NReco.Data/DbDataView.cs @@ -140,7 +140,7 @@ string BuildSelectColumns(Query query, ISqlExpressionBuilder sqlBuilder) { // special handling for 'count(*)' mapping if (f.Expression.ToLower()=="count(*)") fld = ApplyFieldMapping("count(*)"); - fld = String.IsNullOrEmpty(f.Name) ? fld : String.Format("({0}) as {1}", fld, sqlBuilder.BuildValue((QField)f.Name) ); + fld = String.IsNullOrEmpty(f.Name) ? fld : String.Format("{0} as {1}", fld, sqlBuilder.BuildValue((QField)f.Name) ); } if (columns.Length>0) columns.Append(',');