locked
Table's Relation,Please help RRS feed

  • Question

  • User-1251655565 posted

    I have two tables one having the primary key and another the forign key

    the two tables contains data

    the primary table already contains data id,name and departmentID ( i added them from stored procedure)

    the secondary table gets the data from excel file( I import the excel file to this table succesfuly)

    when i made import process some employees in this process does not exsist thats not the problem,

    i need to make a filter (or a query) thats select the data that's in primary table but not exsist in secondary table where date =1/2/2011

    this is the query but how i can insert where condition where data=1/2/2011

    Select pt.*
    from Primary_table as pt
    left join
    Secondary_table as st on pt.PK = st.FT
    where st.ID is null

    Asp.net c#

    Tuesday, November 8, 2011 4:28 AM

Answers

  • User-784583665 posted

    Check following Query it will help you

    Select pt.*
    from Primary_table as pt
    left join Secondary_table as st on pt.PK = st.FT and
    date ='1/2/2011'
    where st.ID is null 

    Please mark as answer if useful

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 8, 2011 4:42 AM