Advertisement

12.10.2007 at 08:44AM PST, ID: 23013355
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

Oracle join weirdness

Asked by monosodiumg in Oracle Database

Tags: , ,

The query below inner joins C.card_num = arr.cardnumber yet returns rows where these two columns are different.

The behaviour only occurs when the irrelevant analytic subquery is present. This is a minimal version of a larger query where the analytic subquery is relevant but the behaviour is the same.

It looks as is the analytic first_value is contaminating the SELECTed value but not the join computation.

The Arr.id and C.id columns show correct values. Only the arr.cardnumber column comes out wrong. The correct values for the arr.cardnumber columns are the values that appear in the C.card_num column.

What is going one and what do I do about it?

 ARR.id
 , C.id
 , c.CARD_NUM
 , ARR.CARDNUMBER
from acct_req_res arr
    inner join card C on C.card_num = arr.cardnumber
    inner join (select distinct cv.code_id, first_value(cv.code_description)  over (partition by cv.code_id order by cv.eff_dte desc) as code_description from
                        code_value cv where cv.status_cde = 'A' and cv.code_type = 'CARD_STATUS' ) CV_CS
        on CV_CS.code_id = c.card_status_cde

Results:
16444281      4787228      0836      4215
16438092      6044680      4504      4215
16437702      12816728      8618      4215
16438012      6032149      3166      4215Start Free Trial
[+][-]12.10.2007 at 08:56AM PST, ID: 20443056

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.10.2007 at 10:45AM PST, ID: 20443995

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 01:44AM PST, ID: 20448176

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 03:05AM PST, ID: 20448451

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 03:12AM PST, ID: 20448471

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.11.2007 at 03:20AM PST, ID: 20448498

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: join, distinct, select
Sign Up Now!
Solution Provided By: nav_kum_v
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12.11.2007 at 09:31AM PST, ID: 20450907

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628