order 元素

指定结果行的排序顺序。

了解如何使用 FetchXml 对行进行排序

Example

本示例按升序createdonname返回帐户记录和accountnumber值。

<fetch>
  <entity name='account'>
    <attribute name='name' />
    <attribute name='accountnumber' />
    <attribute name='createdon' />
    <order attribute='createdon' />
    <order attribute='name' />
    <order attribute='accountnumber' />
  </entity>
</fetch>

特性

Name Required? Description
attribute 是的 name 按其对数据进行排序 的属性元素
alias 要按 /> 对数据进行排序的属性元素
descending 是否按降序对数据进行排序。
entityname 使用此属性可以指定元素的 link-entity 排序顺序,以便不最后应用它们。 order在元素内entity,设置为 entitynamealias .link-entity. 的值。 了解如何先应用 link-entity 订单

父元素

Name Description
实体 指定 提取元素的子元素,即查询的“父实体”。 只允许一个实体。
link-entity 联接与 实体链接实体 相关的表,以返回包含结果的其他列。 还与 筛选器 元素一起使用,以 对相关表中的列值应用条件