LucaCappelletti94 commented on issue #273:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/issues/273#issuecomment-5791749023

   Sorry, my bad, this still fails. In MSSQL, when a `SELECT` has no `FROM`, 
the `FOR` of `FOR JSON` and `FOR XML` is parsed as an implicit column alias, as 
these cases show.
   
   ```sql
   SELECT 1 FOR JSON PATH
   -- sql parser error: Expected: end of statement, found: JSON at Line: 1, 
Column: 14
   
   SELECT GETDATE() FOR XML PATH
   -- sql parser error: Expected: end of statement, found: XML at Line: 1, 
Column: 22
   ```
   
   The `CREATE VIEW [AC_metadata].[ac_cfg_columns]` example above fails the 
same way, with `Expected: ), found: JSON at Line: 34, Column: 5`. With a 
`FROM`, as in `SELECT a FROM t FOR JSON PATH`, it parses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to