Question : Left Outer Join is not working- returns duplicate company names?

SELECT r.strName, u.strRegistrationUserName FROM i2Integration_EventRegv45_RegistrationUser u left outer join i2Integration_EventRegv45_Registration r on r.intRegistrationID = u.intRegistrationID

returns ??
-----------------------------------------------------------------------------------------------------
Petersen Construction Services      Perry Petersen
CALTROP Corporation                      Beth Power
Covello Group, Inc                                      David Jaworski
Harris & Associates                                      Dana LeSher
Harris & Associates                                      Ann Weaver
Harris & Associates                                      Tim Peel
Harris & Associates                                       Brad Chadwick
Kitchell CEM                                       Brian Bush
Holdrege & Kull                                       Tom Holdrege
Holdrege & Kull                                       Jeff Cox
Construction Testing Services                        Aaren McBride
Construction Testing Services                        Josh Romero
TRS Consultants Inc                                       Peter Owen
Vanir Construction Management, Inc.       Jeffrey Palumbo
4LEAF, Inc.                                       John Mahoney

Answer : Left Outer Join is not working- returns duplicate company names?

same idea

Dim strSelectCommand As String = "select case when rn = 1 then strName else char(32) end as strName, strRegistrationUserName, case when rn = 1 then cast(intRegistrationID as varchar) else char(32) end as intRegistrationID, case when rn = 1 then strEmail else char(32) end as strEmail, case when rn = 1 then cast(fltOrderAmount as varchar) else char(32) end as fltOrderAmount, case when rn = 1 then cast(strRegistrationStatusID as varchar) else char(32) end as strRegistrationStatusID, case when rn = 1 then cast(dtmCreated as varchar) else char(32) end as  dtmCreated from ( SELECT r.strName, u.strRegistrationUserName, row_number() over (partition by r.strName order by r.strName) rn, r.intRegistrationID, r.strEmail, r.fltOrderAmount, r.strRegistrationStatusID, r.dtmCreated  FROM i2Integration_EventRegv45_Event e, i2Integration_EventRegv45_RegistrationUser u left outer join i2Integration_EventRegv45_Registration r on r.intRegistrationID = u.intRegistrationID where e.intEventID = r.intEventID and (YEAR(e.dtmEvent) = '" + ddlYear.SelectedValue + "' AND MONTH(e.dtmEvent) = '" + ddlMth.SelectedValue + "' AND strTitle = '" + DroplistData.SelectedValue.Tostring.replace("'","''") + "') and r.strPaymentMethodID = 'Check' and ((r.strRegistrationStatusID = 'pnd') OR (r.strRegistrationStatusID = 'cmp' ))) a"  

Random Solutions  
 
programming4us programming4us