Sqlplus - Query syntax question

Posted on 2014-03-18
Last Modified: 2014-03-21

Im running Oracle 10g and Im having a problem with a query...

My query (not sure if this would be the best way to do it) but it goes through a bunch of table that are related to get a final result.. the problem is that Im getting several duplicated results...

I know ts hard to help like this but I cant give details of the tables..

  and subs.UEMTE_ID is not null
  and subs.UEMTE_ID = terminal.UEMTE_ID
  and terminal.UEMTT_ID is not null
  and terminal.UEMTT_ID = ttype.UEMTT_ID

As you can see Im going through the tables...

Fisrt I filter the subs table, then I pass to the ternminal table using the UEMTE_ID (common in both)... then I need the UEMTT_ID to go to the ttype tabel...

The problem is that the UEMTT_ID has a common number in several rows of the ttype table... so thats shy I think Im getting dulicated results...

ANy suggestion?

Question by:joaotelles
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 300 total points
ID: 39937238
please read up this article, it shall explain the "issue" and give you the path to the solution:

Assisted Solution

dannygonzalez09 earned 200 total points
ID: 39937285
have you thought about using Rank() function ? it should help you in removing the duplicates

Author Closing Comment

ID: 39945215
Tks for the articles!

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question