Skip to main content
Inspiring
Jan 9, 2021 6:50 PM UTC
Question

QoQ OR Joins + Unions using junction table?

Apologize in advance for not seeing the obvious query to get the result set I need, but a picture is worth...

Thanks for your advice.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    BKBK
    Community Expert
    Community Expert
    Jan 9, 2021 7:18 PM UTC

    I cannot see how this is possible. The keys of the Name table (nameId, ownerId) are unrelated to those of the Spouse table (familyId, husbandId, wifeId).

    Translate
    Inspiring
    Jan 9, 2021 9:54 PM UTC

    Thank you for your observation.

    I was sure that NameID (4000 individuals) in the Name Table equaled HusbandIDs (2000) & WifeIDs (2000) from the junction table. However, when I ran a simple query listing all, I realized that the junction table has bad data- no use at all.

    So I'm creating a new DB starting with one main table with all clean records.

    As long as your reading this, inserting values from DB1 ( #Request.BaseDSN1#)/existing table to DB2 (#Request.BaseDSN2#)/new table- can one do something like:

    <CFSET DB2 = #Request.BaseDSN2#>

    <CFSET DB3 = #Request.BaseDSN3#>

    INSERT INTO DB3.....etc

    SELECT ...etc

    FROM DB2?

    I do appreciate your time- I wish they had spell-check on the community support app- this is Adobe...

     

     

    Translate