| | |
DISTINCT on One Column Only
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 8
Reputation:
Solved Threads: 0
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
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
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.
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.
•
•
Join Date: Sep 2009
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
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.
Thanks,
Lewis
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.
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.
![]() |
Similar Threads
- Update Stmt - Update same record multiple times (MySQL)
- Need a Distinct Column in my inner join statement (ASP)
- Count/Sum distinct problem (MS SQL)
- distinct Multi Union help (MS SQL)
- Enum vlues into Combo (Visual Basic 4 / 5 / 6)
- multi column data display (PHP)
- Addition 2 column in sql (MS SQL)
Other Threads in the Oracle Forum
- Previous Thread: removing first blank line in csv file
- Next Thread: Sql query to get max 5 values
| Thread Tools | Search this Thread |
Tag cloud for Oracle
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware erp federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho





