DISTINCT on One Column Only

Thread Solved

Join Date: Sep 2009
Posts: 8
Reputation: Billingsley is an unknown quantity at this point 
Solved Threads: 0
Billingsley Billingsley is offline Offline
Newbie Poster

Re: DISTINCT on One Column Only

 
0
  #11
Sep 23rd, 2009
What if I put two columns without subqueries? What would that return? Would it work? And, could I do the same thing using the group functions with 2 colulmns as DISTINCT?

Thanks again,
Lewis



Originally Posted by Billingsley View Post
Thank you. This is valuable. So, if rownum= 1 is returning only the top row for each job_Id, what would happen if I used subqueries for all the columns in the SELECT statement, with no distinct? Actually, I did that. I can see that it only returns the first JOb_ID but it returns 12 of them, and there aren't 12 in the database with that Id. In fact, there is only one. What is happening?

Also, I'm new to this community. I noticed something about clicking a link to promote you or give you points or something. I can't remember. I certainly intend to do that, but what does it mean?

Many thanks,
Lewis
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 118
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster

Re: DISTINCT on One Column Only

 
0
  #12
Sep 23rd, 2009
By only doing subqueries you basically created a cartesian join. It displayed a record for every possible permutation of the query.

There is a simple explantion of cartesian (cross joins) here.

http://www.dba-oracle.com/t_garmany_...cross_join.htm

As for the community. It is expected when a question you ask is solved you set the thread to solved.

Reputation points can be given as well by clicking on the link below the user name. I beleive your reputation altering power is determined by your own reputation and number of threads participated in as well as solved, possibly the reason it is encouraged to mark threads solved when complete as well as keeping the site clean.

You can see what you reputation altering power is by looking in your account by clicking on your own link.

Have a good one.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 8
Reputation: Billingsley is an unknown quantity at this point 
Solved Threads: 0
Billingsley Billingsley is offline Offline
Newbie Poster

Re: DISTINCT on One Column Only

 
0
  #13
Sep 23rd, 2009
Originally Posted by cgyrob View Post
By only doing subqueries you basically created a cartesian join. It displayed a record for every possible permutation of the query.

There is a simple explantion of cartesian (cross joins) here.

http://www.dba-oracle.com/t_garmany_...cross_join.htm

As for the community. It is expected when a question you ask is solved you set the thread to solved.

Reputation points can be given as well by clicking on the link below the user name. I beleive your reputation altering power is determined by your own reputation and number of threads participated in as well as solved, possibly the reason it is encouraged to mark threads solved when complete as well as keeping the site clean.

You can see what you reputation altering power is by looking in your account by clicking on your own link.

Have a good one.
Does your reputation mean anything, or is it just a fun thing? Also, should I add to the reputation after each post?

Thanks,
Lewis
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 118
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster

Re: DISTINCT on One Column Only

 
0
  #14
Sep 23rd, 2009
When you have a higher reputation you get more greeen squares in your header file (I guess it is supposed to signify how competent the responders are) as well I think it might have a reflection on your own altering power (I really haven't figured out how the reputation altering power is assessed but it would make sense).

I beleive it is more important to most that the thread is marked as solved as new members have very limited reputation altering power. Geeks love to help they just need some sort of external gratification for it.



Hiope that helps.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 8
Reputation: Billingsley is an unknown quantity at this point 
Solved Threads: 0
Billingsley Billingsley is offline Offline
Newbie Poster

Re: DISTINCT on One Column Only

 
0
  #15
Sep 23rd, 2009
Well, I certainly appreciate the help you've given me. I've added to your reputation (if I can indeed, add to it???) and marked it solved.

Thanks again,
Lewis
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC