Advertisement

09.22.2008 at 02:35PM PDT, ID: 23753107
[x]
Attachment Details

Translate Oracle SQL to MySQL (NVL, Decode functions and (+) sign)

[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.3
Tags:

MySQL, 5

I have the following oracle SQL statement. I need it translated into MySQL sql.
Code attached below. Specifically, I don't know the NVL function, Decode and (+) sign in the where clause.

Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
SELECT DISTINCT fprd.ui_product_id, fprd.ui_product_name,
                   fprd.ui_displayable, fpd.ui_position_id,
                   DECODE (fpd.ui_position_name,
                           'Default', NULL,
                           fpd.ui_position_name
                          ),
                   NVL (fpd.position_id, 0), fad.ui_ad_model_id,
                   DECODE (fad.ui_ad_model_name,
                           'Default', NULL,
                           fad.ui_ad_model_name
                          ),
                   NVL (fad.ad_model_id, 0), fprd.ext_src_product_id
              FROM fdw_ui_product_position_xref ppx,
                   fdw_ui_product_admodel_xref pax,
                   fdw_ui_product_dimension fprd,
                   fdw_ui_position_dimension fpd,
                   fdw_ui_ad_model_dimension fad
             WHERE fprd.ui_product_id = ppx.ui_product_id(+)
               AND ppx.ui_position_id = fpd.ui_position_id(+)
               AND fprd.ui_product_id = pax.ui_product_id(+)
               AND pax.ui_ad_model_id = fad.ui_ad_model_id(+);
Answered By: angelIII
Expert Since: 03/09/2000
Accepted Solutions: 27294
Computer Expertise: Advanced
angelIII has been an Expert for 8 years 10 months, during which he has posted 86331 comments and answered 27294 questions. angelIII is just one of 2167 experts in the MySQL Server Zone. 1 expert collaborated on this answer, which was graded an "A" by the asker.
 
 
 
 
20081119-EE-VQP-48 / EE_QW_2_20070628