INSERT INTO RegionDetails ( Region_Key , Region_Name , Client_Key , Upd_Date , User_Id ) Select Distinct Region_Key ,Region_Name,Client_Key ,Upd_Date ,User_Id FROM CCareStageTbl CS INNERJOIN Client CL ON CS.Client_Name = CL.Client_Name //could you plz check my joins are accurate or not ,here are also distinct Facility_Name Problem Statement 2. Populate the fields in FacilityDetails table with all distict Facility_Name based on the join on the fields from CCareStageTbl.Client_Name & Client.Client_Name, CCareStageTbl.Region_Name & RegionDetails.Region_Name and RegionDetails.Client_Key & Client.Client_Key and CCareStageTbl.Facility_Type_Desc & FacilityType.Facility_Type_Desc. My Solution 2: INSERT INTO FacilityDetails ( Facility_Key , FacilityType_Key , Facility_Name , Region_Key , Upd_Date , User_Id ) Select Distinct Facility_Key ,FacilityType_Key ,Facility_Name ,Region_Key ,Upd_Date ,User_Id FROM CCareStageTbl CS INNERJOIN Client CL ON CS.Client_Name = CL.Client_Name LEFT Join RegionDetails RD ON CS.Region_Name = RD.Region_Name AND RD.Client_Key = CL.Client_Key LEFT JOIN FacilityType FT ON CS.Facility_Type_Desc = FT.Facility_Type_Desc
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: