|
Posted by Michael Austin on 12/15/06 01:37
Erland Sommarskog wrote:
> Rnt6872 (r_fordjr@msn.com) writes:
>
>> Table A Table B
>>
>>BOL# B_BOL#
>>
>>Chargeback#
>>Hi All,
>>I have been struggling with this for the past few months. I have two
>>tables that I'm inner joining on BOL#=B_BOL#. This works fine. Now for
>>the problem....When there are chargeback# fields associated with B_BOL#
>>they aren't being captured as additional records. None of my tables
>>have primary keys because at any given time any field can contain a
>>"null" value, so I am unable to assign a foreign key, I think. How can
>>I attach the subsequent records to the main record to bring back the
>>additonal data? Please help!!!
>
>
> 1) The standard recommendations for this type of questions, is that
> you post a) CREATE TABLE statements for the tables involed. b) INSERT
> statements with sample data. c) the desired result given the sample.
> This sort of information helps tremendously to understand what you
> want to achieve. Also it makes it very easy to develop a tested
> solution.
>
> 2) If all your columns can be nullable at any time, you have a very
> difficult data model to work with. Most people would probably say
> that your data model is flat wrong. Maybe there is a good reason
> to have all columns nullable, but it sounds very suspicious.
>
>
>
that was so diplomatic...
Given:
"None of my tables have primary keys because at any given time any field can
contain a null"
Then I would say that whoever designed this needed to pass a few more classes in
database design. Your data model needs professional help. Period.
--
Michael Austin.
Database Consultant
[Back to original message]
|