SQL / Power Fx comparison chart #2260
Mike Stall (MikeStall)
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Here's a chart to help show how to query with Power Fx and convert common SQL queries into Power Fx.
Functional
Power Fx is functional. See common functions:
Delegation
Power Fx will also try to compile the queries to an efficient SQL/Odata call as to avoid running the compute client-side. Client-side code is run first to fetch variables and do local computation, and then the server is invoked. This is called "Delegation". A warning is issued if the call can't be delegated. See https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/delegation-overview for details.
Strongly typed
SQL always returns a table. Power Fx is strongly typed and may return a:
Examples:
select * from AccountsAccountsselect top 5 * from AccountsFirstN(Accounts, 5)select top 5 name,score from AccountsShowColumns(FirstN(Accounts, 5), name, score)select * from Accounts where Age > 30Filter(Accounts, Age > 30)select top 1 * from Accounts where Age > 30LookUp(Accounts, Age > 30)select top 1 Name from Accounts where Age > 30LookUp(Accounts, Age > 30).NameSortByColumns(Accounts, Age, SortOrder.Ascending)All reactions