Subject | Re: [firebird-support] Re: SQL 'DeNormalization' approaches |
---|---|
Author | Michael Ludwig |
Post date | 2010-10-14T20:35:31Z |
Svein Erling schrieb am 12.10.2010 um 22:20 (-0000):
statement. :-)
won't work. I think SQL won't work at all here. I'd say the requirement
is wrong.
You could concatenate all the address and phone records in a parseable
string representation, but it feels wrong as well.
--
Michael Ludwig
> > A simplistic overview of the challenge is:Vim tells me there is a closing parenthesis missing from this
> >
> > Input:
> > Name Table (One record per person)
> > Address Table (One to N records per person)
> > Phone Table (0 to N records per person)
> >
> > Output:
> > 1 record per person - with serialized columns for the various
> > address and phone values:
> >
> > ID FirstName LastName Add1 Add2 Add3 Phone1 Phone2 Phone2 <etc>
> WITH RECURSIVE AddressOrder(ID, Address, MyOrder) AS
statement. :-)
> SELECT N.PersonID, N.FirstName, N.LastName, AO1.Address as Add1,If the number of addresses and phone numbers is not known, this approach
> AO2.Address as Add2, AO3.Address as Add3
won't work. I think SQL won't work at all here. I'd say the requirement
is wrong.
You could concatenate all the address and phone records in a parseable
string representation, but it feels wrong as well.
--
Michael Ludwig