[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    [sqlite] Concatenate single field from multiple records?
From:       Greg Robertson <trifusion () gmail ! com>
Date:       2009-02-26 17:59:16
Message-ID: 151e70a00902260959u17bb3c25oc76885f493b2fb4e () mail ! gmail ! com
[Download RAW message or body]

Is it possible with just an SQL to Concatenate the content from
several records of a single field with perhaps a character inbetween?

For example if I have TableA that has Field1 with the following info in Field1:

rec1:  How
rec2:  are
rec3:  you
rec4:  ?

Would it be possibly using only SQL to output a single field with the content"
"How are you ?"

This would mean concatenating the fields with a space between each field.

I can do this programatically with a simple 'SELECT Field1 FROM
TableA' and then cycling through the result and building a string, but
I was curious if this is possible using only SQL.


Thanks

Greg
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic