Link to home
Start Free TrialLog in
Avatar of gfedz
gfedzFlag for United States of America

asked on

Sql / Oracle querry help

I am trying to get everyones name and number from the SIDPERS database  that exists in my SQL table with a intRosterID = 4.  When I querry this code below, it gives me everyone in the SIDPERS database, it does not show only the people in my SQL table.  Any ideas on how to tweak this?
SELECT RTRIM(SUBSTRING(GR_ABBR_CODE, 1, 3)) + ' ' + RTRIM(NAME_IND) AS NAME, SSN_SM 
FROM OPENQUERY(SIDPERS, 'SELECT s.GR_ABBR_CODE, s.SSN_SM, p.NAME_IND FROM PERS_SVCMBR_TBL s, PERS_PERSON_TBL p
WHERE s.SSN_SM = p.SSN_SM') WHERE EXISTS (SELECT intMemberID FROM tblMember WHERE intRosterID = 4) ORDER BY SSN_SM

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gfedz

ASKER

That's exactly what I needed.  Thank you for your time.