I have a Fact_Actuals yable with a new column "Segment_Id".
I need to insert the segment id from DimsegmentMaster into Fact_Actuals.
Link is with SegmentMaster and Source Table column.
Link is with FactTable is Measures of the Source Table column below.
Kindly provide me the update query, as my below query is not fine.
UPDATE Application_DB.[cdw].[Fact_Actuals] set segment_sid = (SELECT c.SID FROM Application_DB.[cdw].[Fact_Actuals] b inner join Source_DB.STA.SourceTable a ON convert(decimal(20,10),LTRIM(RTRIM(a.[K308]))) = b.NetExternalSales and convert(decimal(20,10),LTRIM(RTRIM(a.[K203]))) = b.Quantity_CON and convert(decimal(20,10),LTRIM(RTRIM(a.[K202]))) = b.Quantity_KG inner join Application_DB.cdw.DimSegmentMaster c ON RTRIM(a.[C005])=c.SegmentOriginal )