Can I use operators to decode those pennies... decode (w_code, 'CH', (pob_desc = 'CART'), pob_desc)

As in the title of the question

Depending on whether the value of w_code = "CH", then set the pob_desc to the "CART" whether what it is

Decode (w_code, 'CH', (pob_desc = 'CART'), pob_desc)

I get a missing closing parenthesis error

Hello

997407 wrote:

Thanks for the reply,

I was hoping to use the decoding in a where clause as a predicate clause then if the w_code was CH then the field need to be 'CART' pob_desc else pob_desc.

DECODE and CASES are not necessary in the clause WHERE; usually, there are easier ways to do everything you need.  For example:

WHERE (w_code <> 'CH')

OR pob_desc = "CART".

)

If you want to really use DECODE, then do something like:

WHERE DECODE (w_code

, 'CH', 'BASKET '.

pob_desc) = pob_desc

As always, be careful if the column can be NULL.

I hope that answers your question.

If this isn't the case, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.

Explain, using specific examples, how you get these results from these data.

Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: Re: 2. How can I ask a question on the forums?

Tags: Database

Similar Questions

  • can I USE greate to decode

    My dear

    If I have the query like this
    SELECT name, salary,
    (CASE WHEN SALARY < 5000 THEN 'LOW'
    WHEN SALARY < 10000 THEN 'AVERAGE '.
    WHEN SALARY < 20000 THEN 'GOOD '.
    income of another 'excellent' end)
    EMPLOYEES;


    How can I USE decode instead of case

    Thanks in advance

    You can do this by signs, for example

    select CASE when sale_amount > 250000 then 'Really High Level'
                when sale_amount > 100000 then 'High Level'
                else 'Not so high'
           END
      from t
    
    Using decode, we can do this with SIGN:
    
    select decode( sign( 100000 - sale_amount ) ,
                   -1, 'High Level',
                   'Not so high' )
      from t; 
    
  • Can I use Replace in decoding?

    Hello

    I try to use replace function inside a function of decoding.

    Here's how I do it:

    Select
    SUBSTR)
    DECODE)
    IH. DRVD_ALT_MAIL_ADDR_PRIM_FLAG,
    ' N ',
    REPLACE)
    IH.subs_addr_1
    || ' '
    || IH.subs_addr_2
    || ' '
    || IH.subs_city
    || ','
    || IH.subs_state_code
    || ' '
    || IH.subs_zip_code,
    ' ',
    ' '
    ),
    « Y »,
    REPLACE)
    IH. PRINT_ALT_MAIL_ADDR_LINE_1
    || ' '
    || IH. PRINT_ALT_MAIL_ADDR_LINE_2
    || ' '
    || IH. PRINT_ALT_MAIL_ADDR_LINE_3
    || ' '
    || IH. PRINT_ALT_MAIL_ADDR_LINE_4
    || ' '
    || IH. PRINT_ALT_MAIL_ADDR_LINE_5
    || ' '
    || IH. PRINT_ALT_MAIL_ADDR_LINE_6,
    ' ',
    ' '
    )
    ) 1,.
    50
    )
    address of x


    Can someone please tell me what I'm doing wrong here, it always gives me an error missing closing parenthesis.

    Thanks in advance.

    Hi Jimmy,.

    Looks like you're absent from the first comma in the SUBSTR function

    SELECT SUBSTR (
             DECODE (
               ih.drvd_alt_mail_addr_prim_flag,
               'N', REPLACE (
                         ih.subs_addr_1
                      || ' '
                      || ih.subs_addr_2
                      || ' '
                      || ih.subs_city
                      || ','
                      || ih.subs_state_code
                      || ' '
                      || ih.subs_zip_code,
                      ' ',
                      ' '
                    ),
               'Y', REPLACE (
                         ih.print_alt_mail_addr_line_1
                      || ' '
                      || ih.print_alt_mail_addr_line_2
                      || ' '
                      || ih.print_alt_mail_addr_line_3
                      || ' '
                      || ih.print_alt_mail_addr_line_4
                      || ' '
                      || ih.print_alt_mail_addr_line_5
                      || ' '
                      || ih.print_alt_mail_addr_line_6,
                      ' ',
                      ' '
                    )
             ), -- HERE
             1,
             50
           )
             address
    FROM   x
    

    Concerning
    Peter

  • Can I use Adobe Stock images for reference shots in limited edition prints and paintings for sale?

    As a painter, it is difficult to take animals, etc. blows of reference for paintings. Can I use stock adobe like those of reference shots for paintings that will sell eventually as well as limited edition prints?

    Hello

    A licence would be required - see pictures of free of rights, pictures and graphics. Adobe Stock

    Kind regards

    Bev

  • Variable LabVIEW can be used as those found in a Java program?

    I created a program of decoding in Java which reads in a number or code, and returns the decoded version of this number.

    I tried initially to create this program inside LabVIEW herself but was prevented by my lack of experience and knowledge of what LabVIEW may or may not do, and how to approach the problem in LabVIEW.

    My stumbling in LabVIEW seem to be tables and variables work. I probably do things completely wrong, more than likely because I'm thinking in Java instead of LabVIEW.

    Any help that can be given is most appreciated. I've also attached a text document with my code Java inside. It is not perfect, but it works.

    If I need to clarify anything just ask.

    Once again thanks for any help in advance.

    In LabVIEW, the wire is the variable. The way in which you pass parameters to the functions (subvis) is with a wire through the side of the connector. Ditto to return results.

    Forget that local variables exist! Many new programmers come from a text based programming background discover local and global LabVIEW variables far too early. As the tape, they can be useful. But it is possible to write huge complex applications without touching. And the code is much simpler than the programs less complexity that use local and global variables.

    Since you are new to LabVIEW, you can become a very good programmer if you keep the following in mind. It's a little confusing, but "local variables" and "global variables" are not really variables in labVIEW as they are in Java. The sons are the variables. These things from the rectangle, you create controls or indicators look more like a function for the control or the indicator. They cannot exist without an owner indicator or a control; It is unfortunate that they are called variables, but they are a relic of the stone age when the code was carved in the walls of the cave.

  • error in pseudo-column "DECODE" can be used within an SQL statement

    Hi gurus,

    Your help is grealty appreciated. Please help me.


    I'm trying to see if I can use the function decode as below and get the error, here below vPlatformfrom value would be QA or MTS


    vDataBase1 :='@'|| Decode (vPlatformfrom, 'STD', 'STD', 'QA', 'QA')


    Before we check function NVL to a single platform, but now we need the database based on the platform is here.

    -vDataBase1 :='@'|| NVL (vPlatformto, 'MTS');

    Error:

    PLS-00204: pseudo-column "DECODE" or function may be used within an SQL statement

    > So, here, instead of the decode function, I can use this case as below:

    Well... you can, but why?  In your CASE, you simply return the same value as the variable.

    You might as well use: vDataBase1: = vPlatformfrom;  It would reach exactly the same thing.

    If vPlatformfrom can be a null value, you will need to decide what database to use or an exception.  I think you're original code (NVL) were probably more correct, but I can't decide which.

    (and don't bother selecting double, it is an unnecessary sql statement which must be analysed, etc..)

  • The pen Surface Pro can be used with a Dell computer, or does it take a specific Terminal?

    The pen Surface Pro can be used with a Dell computer, or does it take a specific Terminal?

    Hi Luzs,

    Could you please let me know if you want to use from the pen of Surface Pro with Adobe Applications for editing?

    Dell computer is also a touch screen computer you have?

    Kind regards

    Tanuj

  • Can I use CC on more than two devices (I have 3 Mac and 1 PC in the House) if I deactivate those that I do not?

    Can I use CC on more than two devices (I have 3 Mac and 1 PC in the House) if I deactivate those that I do not?

    Thank you

    Hi ingrid,.

    You can use Adobe Creative cloud on 2 machines.

    If you disconnect from the creative cloud on 1 machine which you use so you can activate it on another computer.

    Please see the help document:

    https://helpx.Adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html

    Kind regards

    Sheena

  • Can I use third-party widget with Muse, as those of Code Canyon?

    I have not yet tried a Muse, but I'm curious. I used Dreamweaver for many years, but the idea of an app works more as my most comfortable Adobe design programs is very encouraging. However, I'm not sure how so many features I would have. I often use elements of Code Canyon, such as cursors and menus with special functions. Is it possible to use it with the Muse? I am about to launch a new site, and I'm trying o weigh my options.

    Hello SasserCreative,

    In muse, you get an option to enter the external HTML codes of object > insert HTML code but you may need to customize codes in some cases.

    You can also use the widget provided by Code Canyon http://codecanyon.net/category/plugins/muse-widgets.

    There is a muse online widgets library so that you can use to accomplish different things in the muse.

    Adobe Muse Widget Directory

    Kind regards

    Vivek

  • Can I use a stylus to enter data on an iPhone more 6s?

    Can I use a phone from pen to enter text with my phone LG.  I'll be able to do the same with an iPhone more 6s with iOS 10?

    NO.

    See you soon

    Brian

  • Can I use the iTunes on PCs using Windows 10 app or not? !

    Can I use the iTunes on PCs using Windows 10 app or not? !

    You can run the application iTunes, but not those obtained from the iTunes App Store.

    (144221)

  • Can I use a time capsule airport as my external hard drive?

    I have all the products in my house, 5 iPhones apple, 2 MacBooks, an iPad and an apple tv Setup.

    1 first question is the will of the time capsule (I'm looking at the version of 3 TB) Act as my external hard drive?

    2.second the capsule is essentially like a wireless router? If so,is the wifi for your apple products much better? If anyone could break it down into secular terms and highlight some of the advantages and disadvantages , I'd greatly appreciate it.


    (If your wondering I use my Macbook to store a LOT of music, photos, and surf the internet).

    Purchase of a disk external drive for my Macbook Pro is on the top of my to do list, I currently don't have 15 GB of free storage. I know that's not enough space for the computer to function properly. I definitely don't want what I just bought in March. Im trying to learn more about this kind of thing would have made very different when buying my Macbook if I could go back to March.I would be easily paid for the 256 GB of flash storage and would have probably just waited to buy it at all, until the so-called new macbook arrives soon.

    Once again thank you to all those who can help you!

    Mr.705

    1 first question is the will of the time capsule (I'm looking at the version of 3 TB) Act as my external hard drive?

    Although the Capsule is primarily designed to be used in conjunction with Time Machine for backups, it can be used as a network drive for file storage.

    2.second the capsule is essentially like a wireless router?

    He does. In simple terms, you can think of the time Capsule as a wireless router with an Ethernet switch and HDD.

    If so,is the wifi for your apple products much better?

    Not really. Your Apple products are designed to work with routers wireless of any manufacturer, not only those provided by Apple. However, Apple routers are simple to implement and the application to administer is available on both the Mac and iOS devices. There is a version that works on Windows PCs, but is currently outdated and does not support to administer the current base station 802.11ac airport.

  • Satellite A300-1IK - installation after Windows I can't use the multimedia keys

    I tried to clean my laptop, so I installed Windows7 64-bit using my code, but now that I also donwloaded all drivers, I still can't use easy media keys (as for Windows Media Player, or those who must play/stop music, ect..)

    No one knows how to fix this?

    Hi dilettafornasiero,

    I think you forgot to install Toshiba value added Package this package contains the driver for these buttons (lighted) media where you can start Windows media player, for example.

    You should check the Web from Toshiba site again and search for VAP also indicated for Satellite A300. Download and install the package and after I restarted the lighted buttons should start working.

    Check this box!

  • Can I use a brush Sansu on my iPad 2 Air?

    Can I use on my iPad Air2 Sansu brush?

    According to their website, it is compatible with the iPad: http://www.sensubrush.com

    The portable Sensu artist brush & pen is two very useful tools in one - a brush and a stylus. The Solo of Sensu is a series of brushes to help you express your creativity digitally colored and affordable. The two brushes work with devices like the iPad touchscreen®, iPhone®, Surface™, Kindle Fire®, Nexus® and more. Sensu brushes really shine when used with your drawing and painting applications, fresh paint, ArtRage, Sketchbook Pro, paper FiftyThree, Zen brush, http://bit.ly/joc0zm, painter of finger and SketchTime.

  • How can I use the AppleCare with replacements USA helmet in Israel?

    How can I use an AppleCare with replacements USA headphones for my iphone in Israel 6plus? Am I covered overseas?

    Technically, no. The warranty is valid only in the country where the phone was originally sold. However, that restriction is based on the differences between the models of phones sold in different countries and the availability of substitutes service. You may very well be able to get the headphones replaced here since there is no difference between those who were included in phones AND those that are included with the phones sold in your country. Make an appointment at the genius bar or take it to your local CENTER and see what they can do for you.

Maybe you are looking for

  • Why my green button showing a new email goes out after 10 minutes.

    Two weeks when I got a new email, it came in black, so I knew it was a new email and stay dark until I read it. Now it is black but becomes a gray light as if I read it after a few moments.

  • How can I update Safari?

    Several sites are now telling update me of Safari.  My iMac is late 2006, I'm running 10.7.5 and my Safari is 6.1.6.  From what I can glean, can't update Safari without upgrading my OS.  Can I upgrade to 10.8 or above and solve my problem of Safari? 

  • Upgrading processor on the Satellite X 205 s9349

    Hello! Can anyone tell me please what I can install in my processor s9349?FSB is 800 mhz... Toshiba in the bios update bios v.2.10 ISC supports t 8100, t8300, t9300, t9500 onlyand v2.30 - penryn and merom cpu microcode upgrade... so the question is..

  • Optical mouse HP changed the settings to do a right-click instead of left-clicking to open a program.

    Original title: optical mouse 2.4 ghz hp My HP 2.4 GHz wireless optical mouse has suddenly decided to swap the functions of the right and left clicks so that, for example, I do a right click on a program to open it instead of left-click as usual. any

  • Show Interface Tunnel explaination

    Hello Can anyone explain me what this means: Show interface Tunnel Tunnel of transmission bandwidth 8000 (Kbps)Tunnel to receive 8000 (Kbps) bandwidth Is VPN bandwidth? If Yes, we change it? Thank you