Hello everyone i'm trying to get this join to stop doing duplicates and its driving me nuts. Here is some sampel data with some fields taken out because its a long joinFACT_ID FACT_KEY FACT_CONTENT FACT_BKGD_ALIAS FACT_GRA_ALIAS GRA_ALIAS GRA_SITEDIR975 100 <b>Innovation Through Dedication</b> gradient1.gif Bald_Eagle___US_Flag_(100pct_Gauss).jpg Bald_Eagle___US_Flag_(100pct_Gauss).jpg /SiteImages/F99/975 100 <b>Innovation Through Dedication</b> gradient1.gif Bald_Eagle___US_Flag_(100pct_Gauss).jpg gradient1.gif /SiteImages/F99/1083 100 <b>What's New<br /> NULL Null NULL NULL1010 100 NULL SV2C-1000-1111ZZZA SV2C-1000-1111ZZZA /SiteImages/F01/1000 100 NULL SV3C-1500A-1111ZADZ.png SV3C-1500A-1111ZADZ.png /SiteImages/F01/
Next here is the codeSELECT DISTINCT * FROM dbo.FACTS LEFT OUTER JOIN dbo.GRAPHICS ON dbo.FACTS.FACT_GRA_ALIAS = dbo.GRAPHICS.GRA_ALIAS OR dbo.FACTS.FACT_BKGD_ALIAS = GRA_ALIAS LEFT OUTER JOIN dbo.STYLES ON dbo.FACTS.FACT_STYLE_ID = dbo.STYLES.StyleID WHERE dbo.FACTS.FACT_KEY = '100' AND dbo.FACTS.FACT_REGION = 'LEFT' ORDER BY FACTS.FACT_SEQ_NUM"
Don't mind the join on STYLES that part is solid the problem is that on GRAPHICS it give me a double record because the First LEFT OUTER JOIN on the correct GRA_ALIAS in the GRAPHICS table and the second one is not returning only a single record but double. I hope this makes some sense. Thanks again