This can be done with a custom aggregate function.  I posted an example a
week or so ago here in the list (example in C#).

SELECT key, DisplayList(data)
GROUP BY Key

where DisplayList() is a custom function that concatenates it's values.

I don't think this can be done in straight SQL.

HTH,

Sam 


-------------------------------------------
We're Hiring! Seeking a passionate developer to join our team building
products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-----Original Message-----
From: Rich Rattanni [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 24, 2007 9:46 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Help with an unusual query

All:
    I have the following table


key      data
1          'Version 1'
1          'Version 2'
1          'Version 3'
2          'Version 4'
2          'Version 5'

(obviously key is not primary)

I want to write a query that returns

key     data
1         'Version 1 Version 2 Version 3'
2         ' Version 4 Version 5'


Basically I want a row returned for each unique key, but i want the
data column for each key (string data) concatenated together (and
seperated with spaces if possible :) ).

Thanks,
Rich Rattanni


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to