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 8544227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:30:21+00:00 2026-06-11T12:30:21+00:00

I’m getting duplicate account numbers when I user an inner join with transaction table.

  • 0

I’m getting duplicate account numbers when I user an inner join with transaction table. How do limit it so I do not see duplicate account numbers.

SELECT     A01_AccountMaster.AccountNumber, A01_AccountMaster.FamilyMemberType,
           A01_AccountMaster.AccountType, A01_AccountMaster.FamilyId, 
           A01_AccountMaster.Title, A01_AccountMaster.FirstName, 
           A01_AccountMaster.MiddleName, A01_AccountMaster.LastName,
           A01_AccountMaster.Suffix, A01_AccountMaster.OrganizationName,
           A01_AccountMaster.Status,
           T01_TransactionMaster.Date,
           T01_TransactionMaster.AccountNumber AS T01_Accountnumber  
FROM       A01_AccountMaster
INNER JOIN T01_TransactionMaster
      ON A01_AccountMaster.AccountNumber = T01_TransactionMaster.AccountNumber
WHERE      (A01_AccountMaster.Title = 'The')
           AND (T01_TransactionMaster.Date between '01/01/2010' and '09/12/2012')
ORDER BY   AccountNumber;
  • 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-06-11T12:30:22+00:00Added an answer on June 11, 2026 at 12:30 pm

    My suggestion would be to summarize the transaction table to get what you want from it.

    To aggregate the data, use a query such as this:

    select am.*, tm.NumTransactions
    from A01_AccountMaster am join
         (select AccountNumber, count(*) as numtransactions
          from T01_TransactionMaster
          group by AccountNumber
         ) tm
         on am.AccountNumber = tm.AccountNumber
    where . . .
    

    Doing the aggregation at the subquery level simplifies the overall query, since you don’t have to do a group by with lots of fields. Also, if you introduce more tables, aggregating at the subquery level can prevent problems caused by interactions between the records in the other tables.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I'm trying to select an H1 element which is the second-child in its group
I need a function that will clean a strings' special characters. I do NOT
I need to clean up various Word 'smart' characters in user input, including but
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.