ORDER_BY placement in GROUP_CONCAT vs STRING_AGG: MYSQL vs TSQL #754
-
Hi, I'm trying to transpile an sql statement from MYSQL to TSQL, containing GROUP_CONCAT and ORDER_BY. In TSQL, ORDER BY should come AFTER the statement. Below is the expected syntax for both languages.
T-SQL – STRING_AGG()
I'm also very curious to learn more, so that I can solve these issues myself and perhaps contribute. Thank you! P.S
in tsql.py I assume the main problem is that the parser looks for L_PAREN and R_PAREN, to formulate the "this" expression, so it can't find the "ORDER_BY" token for the "ordered" expression. But I'm not sure. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello, This looks a bit tricky at first glance. I think it'll involve creating a separate parsing method for I'll try to solve this for you and ping you when a commit is ready so you can inspect the changes. Thanks for the report!
There's no documentation about the contribution workflow right now, though maybe we'll work on this in the future. For now, you can inspect commits / PRs and see how the workflow looks. For simple issues, it's usually a matter of changing the parser / generator and posssibly adding some new classes in |
Beta Was this translation helpful? Give feedback.
-
@Antusqus I'm not sure if it's the most elegant way to do this, but I tried to tackle the problem you mentioned here: d5846b6. |
Beta Was this translation helpful? Give feedback.
@Antusqus I'm not sure if it's the most elegant way to do this, but I tried to tackle the problem you mentioned here: d5846b6.