Building a comma-separated list of values in an Oracle SQL statement
问题 I'm trying to build a comma-separated list of values out of a field in Oracle. I find some sample code that does this: DECLARE @List VARCHAR(5000) SELECT @List = COALESCE(@List + ', ' + Display, Display) FROM TestTable Order By Display But when I try that I always get an error about the FROM keyword not being were it was expected. I can use SELECT INTO and it works but if I have more than one row I get the fetch error. Why can't I do as follows: SELECT myVar = Field1 FROM myTable 回答1: In