Re: How to return column data as a single string?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Joe Celko (joe.celko_at_northface.edu)
Date: 03/26/04


Date: Fri, 26 Mar 2004 14:01:13 -0800


>> Or future versions could possibly allow SUM() on further datatypes eg
varchars as well? <<

I was just hoping that T-SQL would finally get the || concatenation
operator right.

There is a LIST() function in Sybase SQL Anywhere which does what you
described, but it was not complete the last time I looked at it.

1) It did not give an optional separator; used a comma even if there
were commas in the strings.

2) It did not have LIST(DISTINCT <string exp>) to remove redundant dups.
This is required in all aggregate functions in standard SQL.

3) It did not have a sorting option within the string.

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: GOSUB, the larger picture (was Worldwide known Excellence of GOSUB)
    ... working with actual string data. ... data handling -- as folks were allowed to transition to Byte arrays as desired. ... Two string datatypes wouldn't have been any more difficult or confusing that two ... Do you consider it historical revisionism everytime you learn ...
    (microsoft.public.vb.general.discussion)
  • Re: ERROR: Wrong number of arguments or invalid property assignment
    ... definitely need the single quotes for string values in SQL. ... strSQL = "INSERT INTO Weather ... Wind_MPH, Wind_Gust_MPH, Icon are all varchar datatypes. ... Dim mydoc ...
    (microsoft.public.scripting.vbscript)
  • Re: Operand
    ... It was indeed very nice of you to give me an explanation on datatypes. ... assigned a numeric string to a string, you could treat it just like a ... You have to take more responsibility for ... Sub btnInv ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: my thread of basic Java questions
    ... This question brings up the always popular programming trivia contest...what ... in awk "0" is true because it's a non-null string value. ... define truth values for all values of datatypes, or does it define two ... I think there was an attempt to design a bool class in C++ quite some back ...
    (comp.lang.java.programmer)