SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,631 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello Community,
I'm getting the following error
Incorrect syntax near the keyword 'FROM'.
When I execute the following query:
WITH cte AS ( SELECT accountid FROM STRING_SPLIT(ts_montaguoffice, ';') as ts_montaguofficeonly
FROM core.account ) SELECT accountid, ts_montaguofficeonly
FROM cte CROSS APPLY (SELECT value FROM STRING_SPLIT(ts_montaguofficeonly, ';')) as split
I know its something simple, but could someone let me know how to resolve this error?
Thanks
This works for me:
SELECT accountid, t.value as ts_montaguofficeonly
FROM core.account
cross apply ( select value from STRING_SPLIT(ts_montaguoffice, ';')) as t
But it depends.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
3 deleted commentsComments have been turned off. Learn more