Skip to content

Commit

Permalink
修复sqlserver获取总行数为1的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangziwo committed Jan 12, 2024
1 parent e21f811 commit 16835ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/admin/modules/table/default.go
Expand Up @@ -471,7 +471,7 @@ func (tb *DefaultTable) getDataFromDatabase(params parameter.Parameters) (PanelI
queryStatement = "SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY %s." + placeholder + " %s) as ROWNUMBER_, %s from " +
placeholder + "%s %s %s ) as TMP_ WHERE TMP_.ROWNUMBER_ > ? AND TMP_.ROWNUMBER_ <= ?"
// %s means: table, join table, wheres
countStatement = "select count(*) as [size] from (select count(*) as [size] from " + placeholder + " %s %s %s) src"
countStatement = "select count(*) as [size] from (select 1 as [size] from " + placeholder + " %s %s %s) src"
} else {
// %s means: fields, table, join table, wheres, group by, order by field, order by type
queryStatement = "select %s from " + placeholder + "%s %s %s order by " + placeholder + "." + placeholder + " %s LIMIT ? OFFSET ?"
Expand Down

0 comments on commit 16835ff

Please sign in to comment.