mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 优化 SqlServer2005 TOP 1 查询;
This commit is contained in:
parent
1d06f677e4
commit
d1a6e30644
@ -45,7 +45,7 @@ namespace FreeSql.Custom.SqlServer
|
||||
|
||||
if (_limit > 0 || _skip > 0)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_orderby))
|
||||
if (string.IsNullOrEmpty(_orderby) && (_limit > 1 || _skip > 0)) //TOP 1 不自动 order by
|
||||
{
|
||||
if (string.IsNullOrEmpty(_groupby))
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ namespace FreeSql.Odbc.SqlServer
|
||||
|
||||
if (_limit > 0 || _skip > 0)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_orderby))
|
||||
if (string.IsNullOrEmpty(_orderby) && (_limit > 1 || _skip > 0)) //TOP 1 不自动 order by
|
||||
{
|
||||
if (string.IsNullOrEmpty(_groupby))
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ namespace FreeSql.SqlServer.Curd
|
||||
|
||||
if (_limit > 0 || _skip > 0)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_orderby))
|
||||
if (string.IsNullOrEmpty(_orderby) && (_limit > 1 || _skip > 0)) //TOP 1 不自动 order by
|
||||
{
|
||||
if (string.IsNullOrEmpty(_groupby))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user