943,779 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Marked Solved
  • Views: 11300
  • Oracle RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Sep 23rd, 2009
0

Re: DISTINCT on One Column Only

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



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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Billingsley is offline Offline
8 posts
since Sep 2009
Sep 23rd, 2009
0

Re: DISTINCT on One Column Only

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.
Reputation Points: 91
Solved Threads: 18
Junior Poster
cgyrob is offline Offline
125 posts
since Sep 2008
Sep 23rd, 2009
0

Re: DISTINCT on One Column Only

Click to Expand / Collapse  Quote originally posted by cgyrob ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Billingsley is offline Offline
8 posts
since Sep 2009
Sep 23rd, 2009
0

Re: DISTINCT on One Column Only

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.
Reputation Points: 91
Solved Threads: 18
Junior Poster
cgyrob is offline Offline
125 posts
since Sep 2008
Sep 23rd, 2009
0

Re: DISTINCT on One Column Only

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Billingsley is offline Offline
8 posts
since Sep 2009
Apr 26th, 2010
0

my solution to distinct one field in mutilple fields.

SELECT song_ID,songs.fullname, singers.fullname
FROM music JOIN songs ON songs.ID = music.song_ID
JOIN singers ON singers.ID = music.singer_ID
GROUP BY songs.fullname

You MUST HAVE "GROUP BY" clause to get it works.

Hope this helps.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Quacau corp is offline Offline
1 posts
since Apr 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: PL/SQL command
Next Thread in Oracle Forum Timeline: generating age





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC