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查询呢?

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

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

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

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

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

相关文章:

  • 2021-07-26
  • 2022-01-18
  • 2022-01-18
  • 2022-01-18
  • 2021-12-20
  • 2021-11-22
  • 2022-01-30
  • 2021-11-15
猜你喜欢
  • 2021-08-05
  • 2021-05-17
  • 2021-08-03
  • 2021-08-02
  • 2021-09-19
  • 2022-02-18
  • 2022-01-31
相关资源
相似解决方案