-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
The following query has order by clause:
SELECT p.Name FROM Production.Product p inner join dbo.productdetails pd on p.id=pd.productid
group by p.Name
order by p.nameAnd even with MsSqlDialect, the following sample code will return select.SortBy as null:
var sql = @"SELECT p.Name FROM Production.Product p inner join dbo.productdetails pd on p.id=pd.productid
group by p.Name
order by p.name"
var statements = new Parser().ParseSql(sql, new MsSqlDialect());
foreach (var item in statements)
{
if (item is Statement.Select selectStatement)
{
var select = selectStatement.Query.Body.AsSelect();
// select.SortBy is null
}
}
And the issue happens with DISTINCT:
SELECT distinct p.[Name] FROM Production.Product p inner join dbo.productdetails pd on p.id=pd.productidThe select.DistributeBy is null.
Is there specific option that we need to use to support it?
Metadata
Metadata
Assignees
Labels
No labels