Reputation: 7510
Do you know if there is any equivalent function to the SQL "as" statement in OData?
I need to do something like:
$select=field1 as revenue
Upvotes: 6
Views: 8196
Reputation: 29
In currrent versions you can use compute in System Query Option $apply:
$apply=compute(field1 as revenue)
Upvotes: -1
Reputation: 426
Update (February 2020)
This request has been completed. Within OData, expressions can be given an alias within the $compute
query option or within aggregations.
Original
Something like this has been brought up to the OASIS committee (request: "allow expressions in the $select query option"), and the solution was to defer as a possible enhancement in future versions.
Upvotes: 8