Avoid using OR

Hi guys, I just wanted to ask how I can avoid OR using statement? I read that they are not very precise and or best practices? I have a simple request like this:

{code}

Select

T.account_num,

T.account_date,

T.account_cert,

T.account_code

OF Table T

WHERE

TRUNC (T.account_date) IS NOT NULL AND ((T.account_code IS NOT NULL OR T.account_cert IS NOT NULL))

{code}

I use a case statement instead? If so, how? Thank you

Where did you read that? Can you post a link?

You can use CASES, but I don't know if it will be better

Select T.account_num

T.account_date

T.account_cert

T.account_code

OF Table T

WHERE

TRUNC (T.account_date) IS NOT NULL

AND the case

When T.account_code IS NOT NULL then 1

When T.account_cert IS NOT null then 1

end = 1

Tags: Database

Similar Questions

  • How to avoid using MAX (CASE... WHEN) in a subquery

    Hi everyone, for all of you gurus plsql, I have a question:

    SELECT a.id,

    B.SID,

    b.Name,

    ....

    (CASE WHEN sub_c.value_c = '2015' AND a.code > = 1111 'output value is' | a.value_a ELSE 'Random value' END) output

    FROM table_a a,.

    Table_B b,

    ...

    (SELECT C.a_id

    MAX (CASE WHEN c.code <>'A'

    THEN c.value

    Value_c END)

    OF table_c

    GROUP BY c.a_id

    ) sub_c

    WHERE a.id = b.a_id

    AND a.id = sub_c.a_id (+)

    If they all want table_c a_id, and WHEN the condition is not convinced that they still want this allowance a_id even with null for value_c.

    I tried to outline the most important parts, so the question is: is there a way to avoid using this construction MAX - CASE somewhat expedite this request?

    Thanks for a ton to all those who have taken need to watch this!

    You can move the CASE WHEN c.code <> 'A' predicate in the where clause table_c. Index c.code, then use

    Max (c.value)...

    where c.code <> "A".

    If you have a lot of 'A' values that can speed things up.

  • How to avoid using fractions of EPUB available pixels fixed.

    Apple said to avoid the use of fractional pixels for letter spacing, font size and text placement. Since then, sometimes in the conversion to html and css formatting. Is there a way I can control this?

    Someone had their book rejected because of this?

    Thank you!

    It is perhaps not the droids you are looking for, but a way to check after the fact would be to create a copy of your epub, rename the epub to [epubnam] .zip (change .epub to .zip) and then find the .0px, .1px, .2px generated css file... (if you're handy with regular expressions, you could do a little better by looking for------.) ([0-9] * px, I checked it quickly to regexpal.com, but more robust tests may be in order)

    If you find a fractional value, you could "fix" no closest fractional value which is not trash your design and repackage the epub.

    FWIW, I did a quick scan through my epub css and can't find any decimal values.

  • Avoid using the same query...

    How can I avoid to use the same query again and again using a single query, such as

    SELECT
    a,
    b * (SELECT COUNT (C1) FROM T2);
    c * (SELECT COUNT (C1) FROM T2);
    d * (SELECT COUNT (C1) FROM T2)
    Of
    T1;

    Fanny says:
    How can I avoid to use the same query again and again using a single query, such as

    SELECT
    a,
    b * (SELECT COUNT (C1) FROM T2);
    c * (SELECT COUNT (C1) FROM T2);
    d * (SELECT COUNT (C1) FROM T2)
    Of
    T1;

    A few cross join?

    select a, b*cnt, c*cnt, d*cnt
      from t1, (select count(c1) cnt from t2)
    
  • iOS10 avoiding using fingerprinting on the Lockscreen

    Not wanting to seem too "sheet of Tin-hat", but I have not being updated to iOS10 again and can not - if I am forced to give Apple my fingerprints.

    I've never used the footprint unlock the thing on my iPhone before, because I always felt that it was invasive to give Apple my data of fingerprints (as well as all my other personal info!)

    It seems that iOS10 is taking this choice by removing the slide to unlock - or am I wrong understand the change of internal screen lock.

    Can I still unlock my phone without the help of fingerprints with iOS10 information?

    Just press the button home and you'll be fine.

  • avoid using regexp

    Hello

    I have some channels like 'CCM:234567776767:99978' and I need to extract and save the number in the two ":", so in this case 234567776767.

    Is it possible by using the regular expression, or should I do use substr and instr?

    Thank you!

    SELECT REGEXP_SUBSTR)

    ':' || "CCM:234567776767:99978,"

    ':([^:]*)',

    1,

    2,

    NULL,

    1

    )

    FROM DUAL;

  • Blank CD or avoid use

    Does anyone have suggestions on what blank CD brands to buy or stay away from?  I read somewhere to avoid Memorex, are there any other.  I have TDK and have a problem.  I need to go out and buy new ones, but don't want to have a problem with them also.  Thanks for all the answers.


  • How to avoid using oracle.jdbc.driver.OracleConnection

    I am new to Java, but recently, I have a project on support.

    Problem:

    solution worked on the 1.4 jvm, now on 1.7.

    Respectively, the oracle.jdbc.driver.OracleConnection class has been used.

    Now, I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary (), but... I can't.

    According to the docs, just replace in the code and config files a declaration of the class on another. But I replaced all in all the files of configuration of no. and anyway, no there wasn't that oracle.jdbc.driver.OracleConnection was created. (there is no explicit declaration of the type of connection in the code, everything is configured in the config files)

    Project uses marven, mybatis - 3.1.1. Database: oracle 9

    Driver: ojdbc14 - 9.2.0.5.jar contains two classes: the oracle.jdbc.driver.OracleConnection (for backward compatibility) and oracle.jdbc.OracleConnection.

    The question is what do I need to use a second instead of the first.

    Maybe there are a few java cache? I do not know...

    Everyone knows?

    I solved the problem!

    This thread helped me: https://forums.oracle.com/thread/556426 ("I have to use classes12.zip for this work.")

    The main problem was the jdbc driver - I tried all the ones I found on the page of download of oracle and the only factor that does the job was classes12.jar (Oracle Database 10g Release 2 (10.2.0.1.0)). I replaced it in 'ORACLE_HOME\jdbc\lib\' and 'apache-tomcat\lib\.

    Each driver has its own bugs, and I also did different things, so I can't say that any replacement driver is enough. Te I changed the time zone database, run the tzupdater, vm set param - Duser.timezone = ""-07:00 ", may be something else."

    Thank you very much for the answer so detailed!

  • How to avoid using the library native ttJdbcCS when connecting to remote host?

    I'm testing the Java program with the product that limits the use of native libraries.
    I use the 'client' mode to connect to TimesTen DB (which is done by using the plug, not the shared memory).

    It seems that even in client mode TimesTen JDBC driver calls the library native ttJdbcCS when doing remote queries.
    Why it does not use Java sockets? What is necessary for the native library?
    Is it possible to eliminate the use of native libraries in client mode of the JDBC TimesTen driver somehow?

    I fear that it is not possible to eliminate the use of native code for TimesTen libraries. Both direct drivers and customer are drivers of type 1 (JDBC/ODBC bridge). In both cases the JDBC driver Java code called NYI optimization library ttJdbc/ttJdbcCS and that the library in the direct or client ODBC driver (also called native code).

    If you want to use TimesTen then you must be able to allow the use of these native code libraries. The only other alternative is to implement your own client/server mehcanism such that you can put your own component 'server' on the machine running TimesTen and then use pure Java to communicate with this component of the 'customer '. Generally, it is however a lot of work.

    Chris

  • How to avoid using the 'form' tag

    Hi all

    Is it possible to call a form of my FORMS_PATH site from the browser without using the format of tag in the URL?

    for example, this is my URL to call the form master.fmx--> http:// < machine >: < port >/forms/frmservlet? form = master.fmx, is what I want to call it without using the format of tag after the? in the URL.

    Thank you.

    You can configure your formsweb.cfg file to include a section for your application.

    Lets say you have a section called myApp in the formsweb.cfg file,
    Then you can use http:/.../forms/frmservlet?config=myApp to call the application

    Note: If ssoMode = true in the related section of the formsweb.cfg for the MyApp, then the signature will only kick in the first

    You can use a specific environment file (a copy of the default.env file to your app) and then specify this environment file in the section of the formsweb.cfg file MyApp.

    [myApp]
    envFile = myApp.env
    ssoMode = true
    form = MyAppFirstForm
    pageTitle = MyApp
    ...

    Hope this is useful

  • How to avoid using several golds?

    I have a query that returns a number where I have to change some text if this number fits my criteria... the code looks like this (just an example)

    < name cfquery = "getNumber" datasource = "#Application.dsn #" >
    Select SomeNumber
    Users
    Where blah = blah
    < / cfquery >

    Is there a cleaner way to do this? (see code below)

    Thanks for your help.

    Set the values you want to add to a list, then do this:


    Found!

    Did not find it

  • Can I use your Apple TV with MacBook Air

    I use a MacBook Air, 13-inch, mid 2013, OS X El Capitan 10.11.6. I am interested in Apple TV. With this product I was able to connect my Epson EB - S18 projector to my Mac in order to project movies that I bought on iTunes on my wall of the apartment? Would be there is always a problem to play these movies 'protected' outside the computer itself? Must they be downloaded in SD and not HD? Can I use a patch to connect my Mac to the Thunderbolt port to the projector via the HDMI port? Can I use a patch to connect the VGA cable to the port on the computer to the projector? Please notify.

    Thank you very much.

    Can I use your Apple TV with MacBook Air

    Yes! AirPlay with an AppleTV is the easiest to use and less complicated solution.

    SD / HD makes no difference.

    You will only be able to enjoy the full quality of an HD movie with a better projector however. This model projector is not really intended for presentation of home theater. It will work well. As you can imagine that there is no upper limit on the amount, you can overlook these things, but $2000 is going to buy a nice home theater projector these days. A few years ago, you would need to spend $ 50,000 or more.

    Would be there is always a problem to play these movies 'protected' outside the computer itself?

    No, not if you bought (or leased) from iTunes. They have to play on any device compatible iTunes. You can even use AirPlay to distribute it to your AppleTV from an iPhone.

    Can I use a patch to connect my Mac to the Thunderbolt port to the projector via the HDMI port?

    Yes.

    Can I use a patch to connect the VGA cable to the port on the computer to the projector?

    Not without a converter. Avoid using the VGA if possible. It's a terribly outdated and generally horrible alternative to any digital standard. Since your MBA has a port Thunderbolt, and if your projector has a HDMI input, buy a cheap (± $10) Thunderbolt to HDMI adapter cable. But AirPlay is preferable to a wired connection.

  • iPhone FaceTime always using data

    My friend and I discovered that FaceTime uses always the same when connected to wifi data. If you go to settings > cell phones and walk to FaceTime, you will see the number accumilating even when connected to wifi. None of us had been given using FaceTime, but that he had used 130 MB while I used 260 MB. I disabled the cell data and reminded him and it would be not connected at all. However, I have facetime my iPod with a cell phone off the coast. I don't really know how to make so that he could stop using the data, but at the moment, we use other alternative video chat applications until we have find what is happening.

    iPhone 5 s. iOS 8.4.1

    iPhone 6 s more. iOS 9.3.1

    Hi there logic227,

    Welcome to the communities of Apple Support with your question about FaceTime using cellular data.  I use FaceTime to keep in touch with friends and family a lot and I have the pleasure of helping you avoid using your cell data with it.

    First, you'll want to update all devices to the latest version of iOS.

    Update the software on your iPhone, iPad or iPod touch iOS

    You can do this by Wi - Fi:

    1. Connect your device to the power and connect to Internet with Wi-Fi connection.
    2. Tap Settings > general > software update.
    3. Click Download and install. If a message asks you to temporarily remove the apps because iOS requires more space for the update, click on continue or cancel. Later, iOS reinstall apps that he deleted. If you press Cancel, learn what to do next.
    4. To upgrade now, tap on install. Or you can type later and choose install tonight or remind Me later. If you type install tonight, just plug your device iOS to power before going to sleep. From one day to the next, your device will update automatically.
    5. If requested, enter your access code.

    To avoid using cellular data, go to settings > cellular > USE OF CELLULAR DATA for: and then you place on FaceTime and turn the switch from green to off.  This will prevent FaceTime to use all cell data.

    Best wishes

  • Cannot view bookmark bookmark hotmail (used to)

    from the homepage, I can access a favorite site... but when I try to move from this site (any site favorite) on my favorite site of Hotmail (which is my homepage site), always "expires" and do not make the connection at the back... This is not used as a problem. Restore my computer to an earlier time when he was still working as you wish, does not resolve the problem, either...

    Try to navigate to the bookmarked site Hotmail via the login page main (live.login.com) instead of using a bookmark, the bookmark can be damaged or includes data POST sending is not working.

    It is usually best to avoid using a bookmark in cases like this where.

  • Use of data from 2 GB/hour

    Holy crap, really? Why is it also a big eater of data? I had my mobile attached to use the rest of my data for the month, but not only he has done this, but now I have to pay 3 x excessive use of my data to Vodafone. A video call lasts about 5 hours did this, I can't believe. It's more 4 g btw.

    I've studied other threads, and the consensus, it's just Skype never used for it to be bad. That's happened? And can anyone recommend better programs? I'm not made of money. Once, but never more.

    Wow.

    I hope that by the possibility of one day being able to limit the quality of incoming and outgoing video streams. 2 GB per hour is simply unacceptable, and it is automatic if I use broadband internet. There is really nothing that can be done at the same time however, other than to avoid using it with Skype!

Maybe you are looking for