以下语句对于 ADS 失败
DECLARE @listStr VARCHAR(MAX)
SELECT @listStr = COALESCE(@listStr+',' ,'') + Name FROM Product
SELECT @listStr
请帮忙
以下语句对于 ADS 失败
DECLARE @listStr VARCHAR(MAX)
SELECT @listStr = COALESCE(@listStr+',' ,'') + Name FROM Product
SELECT @listStr
请帮忙
In general, the preferred way to do this is to use whatever function the dbms provides. MySQL has group_concat(), PostgreSQL has array_agg(), Oracle has listagg(), etc. But Advantage Server doesn't seem to support any functions like these.
The next best way is to build a user-defined function. Advantage supports user-defined functions. Here's one implementation; I haven't tested it.
Other ways, which might or might not be possible, are