Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 904141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:00:07+00:00 2026-05-15T16:00:07+00:00

I have the following query. What is strange is that it is returning multiple

  • 0

I have the following query. What is strange is that it is returning multiple records for the same individual – but it should be returning just one row for each individual. It is all LEFT JOINS based on CONTACT1 C – which has only one row for each individual, unlike the other columns which sometimes have multiple rows for the same individual.

    select 
 C.ACCOUNTNO as 'AdmitGold Account',
 C2.UNAMEFIRST as 'First Name',
 C2.UNAMELAST as 'Last Name',
 C.KEY1 as 'Status',
 C.KEY4 as 'People ID',
 C.KEY3 as 'Type',
 C.KEY5 as 'Counselor',
 C.CITY as 'City',
 C.STATE as 'State',
 C.SOURCE as 'Source',
 C.DEPARTMENT as 'Major',
 C2.UGENDER as 'Gender',
 C2.UETHNICBG as 'Ethnicity',
 C2.UFULLPART as 'Full/Part',
 SLF_CLG_CS.EXT as 'College - GPA',
 OFF_CLG_CS.EXT as 'College - GPA Official',
 HS_OFF_CS.LINKACCT as 'HS GPA - Official',
 OFF_SAT_COMP.LINKACCT as 'SAT - Verbal',
 OFF_SAT_COMP.COUNTRY as 'SAT - Math',
 (Cast(OFF_SAT_COMP.LINKACCT as float) + Cast(OFF_SAT_COMP.COUNTRY as float)) as 'SAT - Composite',
 OFF_SAT_COMP.EXT as 'SAT - Essay',
 OFF_ACT_COMP.LINKACCT as 'ACT - English',
 OFF_ACT_COMP.COUNTRY as 'ACT - Math',
 OFF_ACT_COMP.ZIP as 'ACT - Reading',
 OFF_ACT_COMP.EXT as 'ACT - ScRe',
 (Cast(OFF_ACT_COMP.LINKACCT as float) + Cast(OFF_ACT_COMP.COUNTRY as float)+ Cast(OFF_ACT_COMP.ZIP as float) + Cast(OFF_ACT_COMP.EXT as float)) as 'ACT - Official' 
     from contact1 C
 left join CONTACT2 C2 on C.ACCOUNTNO=C2.ACCOUNTNO
 left join CONTSUPP HS_OFF_CS on C.ACCOUNTNO=HS_OFF_CS.ACCOUNTNO
  AND HS_OFF_CS.STATE='O' AND HS_OFF_CS.CONTACT='High School'
 left join CONTSUPP SLF_CLG_CS on C.ACCOUNTNO=SLF_CLG_CS.ACCOUNTNO
  AND SLF_CLG_CS.CONTACT = 'Transfer College' AND SLF_CLG_CS.STATE='S'
 left join CONTSUPP OFF_CLG_CS on C.ACCOUNTNO=OFF_CLG_CS.ACCOUNTNO
  AND OFF_CLG_CS.CONTACT = 'Transfer College' AND OFF_CLG_CS.STATE='O'
 left join CONTSUPP OFF_SAT_COMP on C.ACCOUNTNO=OFF_SAT_COMP.ACCOUNTNO
  AND OFF_SAT_COMP.CONTACT='Test/SAT' AND OFF_SAT_COMP.ZIP='O'
 left join CONTSUPP OFF_ACT_COMP on C.ACCOUNTNO=OFF_ACT_COMP.ACCOUNTNO
  AND OFF_ACT_COMP.CONTACT='Test/ACT' AND OFF_ACT_COMP.STATE='O'
     where 
 C.KEY1!='00PRSP' 
 AND C.U_KEY2='2010 FALL'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:00:08+00:00Added an answer on May 15, 2026 at 4:00 pm

    A left join will produce duplicates in a 1-to-many relationship. Regardless of how many records are in your first table, if you left join to a table with multiple rows for each record in the first table you’ll get more than one row. Select Distinct will remove duplicates if the rows are actually duplicated for all columns, but will not eliminate ‘duplicates’ that have a different value in any column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query which works fine with MySQL but refuses to work
I have the following query of linq to entities. The problem is that it
I have the following sql query for transforming data but is it possible to
I have the following query, now the strange thing is if I run this
I have the following query that returns a set of rows based on some
I have the following query: select column_name, count(column_name) from table group by column_name having
I have the following query: SELECT c.* FROM companies AS c JOIN users AS
I have the following query in iSeries SQL which I output to a file.
I have the following query: UPDATE lessonstatus INNER JOIN user ON lessonstatus.user_id = user.user_id
I have the following Query and i need the query to fetch data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.