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

  • SEARCH
  • Home
  • 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 7811499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:11:04+00:00 2026-06-02T04:11:04+00:00

So I think I’ve seen a solution to this however they are all very

  • 0

So I think I’ve seen a solution to this however they are all very complicated queries. I’m in oracle 11g for reference.

What I have is a simple one to many join which works great however I don’t need the many. I just want the left table (the one) to just join any 1 row which meets the join criteria…not many rows.

I need to do this because the query is in a rollup which COUNTS so if I do the normal left join I get 5 rows where I only should be getting 1.

So example data is as follows:

TABLE 1:
-------------
TICKET_ID      ASSIGNMENT
5              team1
6              team2

TABLE 2:
-------------
MANAGER_NAME   ASSIGNMENT_GROUP  USER
joe            team1             sally
joe            team1             stephen
joe            team1             louis
harry          team2             ted
harry          team2             thelma

what I need to do is join these two tables on ASSIGNMENT=ASSIGNMENT_GROUP but only have 1 row returned.

when I do a left join I get three rows returned beaucse that is the nature of hte left join

  • 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-02T04:11:07+00:00Added an answer on June 2, 2026 at 4:11 am

    If oracle supports row number (partition by) you can create a sub query selecting where row equals 1.

    SELECT * FROM table1
    LEFT JOIN
    (SELECT *
    FROM   (SELECT *,
               ROW_NUMBER()
                 OVER(PARTITION BY assignmentgroup ORDER BY assignmentgroup) AS Seq
        FROM  table2) a
    WHERE  Seq = 1) v
    ON assignmet = v.assignmentgroup
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Think that I have many activities,and all I want is this: I have a
Think Global, Act Local That's what they tell you, however during all my time
Think at this scenario: I have a c# windows form application. This application was
I think there is a logical / mathematical solution to this problem and I
I think this should be an easy problem to solve, however its turned into
I think this is a simple question. We have a MySQL database with a
I think I have got myself into a muddle with this one. My database
Think: tiling my emacs window with eshells, a la xmonad. Is this possible? I
I think know how to do this in C# but I'm having syntax trouble
I think I already know the answer to this but thought I would ask

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.