Unix Technical Forum

Re: Sql to concatenate multiple rows to a single row / column

This is a discussion on Re: Sql to concatenate multiple rows to a single row / column within the Informix forums, part of the Database Server Software category; --> What this exactly do ? Select patid, patname, replace(replace(substr(multiset (select item allergy from allergy where allergy.patid = patient.patid)::lvarchar,11),"'",""),"}","") from ...


Go Back   Unix Technical Forum > Database Server Software > Informix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 09:36 AM
Jean Sagi
 
Posts: n/a
Default Re: Sql to concatenate multiple rows to a single row / column


What this exactly do ?

Select patid, patname,
replace(replace(substr(multiset (select item allergy from allergy where
allergy.patid =
patient.patid)::lvarchar,11),"'",""),"}","")
from patient ;

substr from a multiset ?


J.

bozon escribis:
> Very cool. I was doing it the old fangled way. Nice to know that I can
> always learn something.
>
> 8.5 is the Extended Parallel Server which is great for data warehouses
> but hasn't really caught on.
>
> One quick note since you know that the string "MULTISET{" occurs at the
> begining of the lvarchar there is no sense in searching the whole
> multiset for it you can just use the substr function to remove it. (It
> could also be wrong because one of your patients could be allergic to
> "MULTISET{" ;-) )
>
> Select patid, patname,
> replace(replace(substr(multiset (select item allergy from allergy where
> allergy.patid =
> patient.patid)::lvarchar,11),"'",""),"}","")
> from patient ;

sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 09:36 AM
SaltTan
 
Posts: n/a
Default Re: Sql to concatenate multiple rows to a single row / column


Jean Sagi писал(а):

> What this exactly do ?
>
> Select patid, patname,
> replace(replace(substr(multiset (select item allergy from allergy where
> allergy.patid =
> patient.patid)::lvarchar,11),"'",""),"}","")
> from patient ;
>
> substr from a multiset ?
>


substr from lvarchar

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com