unfortunately i can't do that as the db is commercial and my boss is worried
about competitors also viewing this list.

suffice to say there are three tables.

person(person_id .....fnames_id)

person_fnames(fnames_id,fname_id,pos)

fnames(fname_id,fname)

there is a M:N relationship between person and fnames so a person can have
many forenames etc.
fnames are ordered by pos to indicate their position in the name.

what i need to do is produce a single sql statement that returns <forename
1> <forename2> forename..n> for a particular person.

in effect i will need to return all the forenames in order along with the
surname which is taken from another table with a surname_id posted into
person.

i can get say, three rows for someone that has 3 forenames by joining the
table but i don't know if i could return what is in effect an array and
project it from the query so i have a formatted name ...


thanks,

Steve

> -----Original Message-----
> From: Dirk Zoettl [mailto:[EMAIL PROTECTED]]
> Sent: 26 April 2002 10:36
> To: [EMAIL PROTECTED]
> Subject: Re: query question ...
> 
> 
> Hi Steve,
> 
> I propose you provide the create statements to build the
> tables and some insert statements for example data.
> 
> Sincerely,
> Dirk Zoettl
> 
> P.S: Getting help is more probable, if you help the helper !
> __________________________________________________________________
> 
> Steve Brett wrote:
> > 
> > i have a table of people and a table of names( forenames 
> and surnames).
> > 
> > there is a link table with person_id,fname_id and position in it and
> > surnames are kept in a seperate table.
> > 
> > what i need to do is pull out a specific person with the 
> name in the format
> > 
> > <fname1> <fname2> <fname3> <surname>
> > 
> > i can't work out how to do it in a single sql statement ....
> > 
> > any ideas ?
> > 
> > Steve Brett
> > SID
> > EMIS Ltd.
> > 
> > "Privileged and /or Confidential information may be 
> contained in this
> > message. If you are not the original addressee indicated in 
> this message (or
> > responsible for delivery of the message to such person), 
> you may not copy or
> > deliver this message to anyone. In such case, please delete 
> this message,
> > and notify us immediately. Opinions, conclusions and other 
> information
> > expressed in this message are not given or endorsed by my 
> firm or employer
> > unless otherwise indicated by an authorised representative 
> independently of
> > this message."
> > 
> > Egton Medical Information Systems Limited. Registered in England. No
> > 2117205.
> > Registered Office: Park House Mews, 77 Back Lane, Off 
> Broadway, Horsforth,
> > Leeds, LS18 4RF
> > 
> > _______________________________________________
> > sapdb.general mailing list
> > [EMAIL PROTECTED]
> > http://listserv.sap.com/mailman/listinfo/sapdb.general
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to