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.name
And 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.productid
The select.DistributeBy is null.
Is there specific option that we need to use to support it?
The following query has order by clause:
And even with
MsSqlDialect, the following sample code will returnselect.SortByas null:And the issue happens with DISTINCT:
The
select.DistributeByis null.Is there specific option that we need to use to support it?