[AX]AX2012开发新特性-Query的Having节点

AX2012的Query多了一个Having节点,对应SQL语句的Having查询条件。

假设SQL查询是这样的:

select
        ct.DestinationCodeId
       ,count(*)
    from
        CustTable as ct
    where
        ct.DestinationCodeId != 'Gen_5'
    group by
        ct.DestinationCodeId
    having
        count(*) > 6
    order by
        1;

在AOT中创建Query如何来实现这个SQL查询呢?

AOT的Query多了个Having节点,可以添加查询条件,比如这里的Count(CustTable_1.RecId):

注意可以把Query把AllowCrossCompany属性设置为Yes,得到的SQL查询语句不包含对公司的查询条件限制。

比较简单的示例,更多内容参见MSDN:http://msdn.microsoft.com/en-us/library/hh745337.aspx

posted @ 2012-08-15 11:37  断水流  阅读(532)  评论(0编辑  收藏  举报