Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run partitionby with plain select columns #150

Closed
ainsleybernard opened this issue Jan 10, 2022 · 3 comments
Closed

unable to run partitionby with plain select columns #150

ainsleybernard opened this issue Jan 10, 2022 · 3 comments

Comments

@ainsleybernard
Copy link

Hello

I get an error when running the following sql, using version 5.4 sql4cds engine

SELECT accountid,
COUNT(accountid) OVER (PARTITION BY accountid ) AS test
FROM account

image

but this works perfectly


SELECT 
COUNT(accountid) OVER (PARTITION BY accountid ) AS test
FROM account

It seems like the code is seeing COUNT and assuming its an aggregate function like


SELECT COUNT(accountid)
FROM account
GROUP BY accountid

Im not having the issue running it directly in SSMS using version 5.2.2

@MarkMpn
Copy link
Owner

MarkMpn commented Jan 10, 2022

Yes, window functions are not currently supported. It's something I'm investigating for a future version, but for the next update I'll look at making sure it generates an appropriate error when a window function is used.

@ainsleybernard
Copy link
Author

alright sounds good thanks! Just curious will it make its way in near future or its some down the road. As its kind half working now. Just wondering if I can bank on it working sooner or later :)

@MarkMpn
Copy link
Owner

MarkMpn commented Jan 10, 2022

I can't guarantee anything, but it is supported by the TDS endpoint either in SSMS or SQL 4 CDS if you need it today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants