Home » SQL & PL/SQL » SQL & PL/SQL » remove duplicates from a query containing more than 1 table
remove duplicates from a query containing more than 1 table [message #218271] Wed, 07 February 2007 10:12 Go to next message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

I have a query I have created, how ever is has too many duplicates, like 50k, I added a DISTINCT to one of the variables and now its like 25k, what else can I use to remove all these duplicates it should have less than 1000 records. Heres my code. Thanks for any help.

select distinct(p.project_id), p.segment1, p.name, I.INVENTORY_ITEM_ID, I.SEGMENT1, M.PROJECT_ID, M.INVENTORY_ITEM_ID, M.PROJECT_NUMBER ,
a.task_id, a.project_id, A.TASK_NAME, A.TASK_NUMBER, D.PROJECT_ID, D.PROJECT_NUMBER, D.PROJECT_NAME
from SYSTEM_ITEMS I, SCHEDULE_ITEM_DATES_V M, pa.pa_projects_all p, pa.pa_tasks a , DISCRETE_JOBS_V D
where p.project_id = a.project_id and P.PROJECT_ID = D.PROJECT_ID
AND m.project_id = p.project_id and I.INVENTORY_ITEM_ID = M.INVENTORY_ITEM_ID and
p.project_id = '165003' AND P.SEGMENT1 = '1018101'
Re: remove duplicates from a query containing more than 1 table [message #218273 is a reply to message #218271] Wed, 07 February 2007 10:14 Go to previous messageGo to next message
BlackSwan
Messages: 25043
Registered: January 2009
Location: SoCal
Senior Member
Do NOT cross/multi-post!
Re: remove duplicates from a query containing more than 1 table [message #218291 is a reply to message #218273] Wed, 07 February 2007 11:16 Go to previous message
deahayes3
Messages: 203
Registered: May 2006
Senior Member

Not intentional, wasnt sure if posted in the right forum
Previous Topic: Difference in the execution timings .. plz explain
Next Topic: data mismatch issue
Goto Forum:
  


Current Time: Wed Dec 07 08:30:54 CST 2016

Total time taken to generate the page: 0.15266 seconds