Skip to main content

If Else clause or decode or Case in Where clause

 If Else clause or decode or case in Where clause


We are not going to check here if else or decode or case but i am going to tell u an alternate.........


Suppose we need workorder's with status =APPR  else I need WAPPR but i have to give preference to APPR solution

select * from maximo.workorder where status in (APPR,WAPPR) order by status desc


Now suppose we have 2 records one is appr and one is wappr

Then modify this query like 
Select * from maximo.workorder where workorderid in (
select workorderid  from maximo.wokrorder where workorderid in (select workorderid from maximo.workorder where status in (APPR,WAPPR) order by status desc
)  where rownum<2)


So we are using here rownum to display approve before wappr ............


If we have only wappr records then our subquery will return wappr records only and with  rownum<2 

we will get only one record....................


This you can use in relationship of maximo where u have to find 1 record only as fetch 1st alternate.......

Comments

  1. CasinoDaddy - drmcd
    Discover 구리 출장샵 over 삼척 출장안마 500 real money casinos and 속초 출장샵 gambling games at CasinoDaddy. Join today and start earning points for playing 논산 출장마사지 & win 서울특별 출장안마 real money!

    ReplyDelete

Post a Comment

Popular posts from this blog

Maximo Bean Class Methods

Methods of Bean Classes of Maximo Reset Method   This method is called when a new filter is applied for the dialog's MboSet.  @see psdi.webclient.system.beans.DataBean#reset()     @Override     public void reset() throws MXException     {             try         {                 saveCurrentSelection();         }         catch (RemoteException e)         {             handleRemoteException(e);         }         super.reset();     } Initialize It is used to initialize values on a d...

Maximo Interview Questions - Maximo Technical and Functional Questions

Technical Questions How do you rate your self in :- 1. PL/SQL 2. Java 3. Automation Script 4. Mbo Customization 5. Admininstration Jobs 6. Funtional Concepts 7. Maximo Configuration Do not rate anything less than 7 unless you don't want interview to skip the topic Deployment / Administration  1. Explain LDAP integration? 2. Explain SSO and LTPA token? 3. What is global security? 4. How session is managed in Websphere or Maximo? 16. How to insert attributes from Backend? 5. How request is passed in Maximo? 6. How to do horizontal and vertical clustering? 7. Explain how you confire websphere for maximo manually? 8. What are Websphere MQ? 9. What is JMS, Connection Factory and Queues? 10. What is difference between vmm and ldap sync integration ? 11. What is Standalone and federated repository? 12. How to install a new language in Maximo? 13. What are the steps to apply a Fix pack in Maximo, Websphere or DB2? 14. Have you worked on any performance checking tools? 15...

BMXAA1581E No object with the name {0} is set up in the JNDI tree. Check the JMS/JNDI setup in the server administration console

 BMXAA1581E No object with the name {0} is set up in the JNDI tree. Check the JMS/JNDI setup in the server administration console This error might come after you setup queue after you create destination then queue in websphere and add same in external system Add/Modify queue and same thing in main table of external system..... When u click on publish maximo can give this error......... reason is JNDI name you specifiy in maximo when adding queue from select action does not match with jndi name you specify in websphere...... Go to Websphere ->resources->JMS->queues ->and open your queue and check jndi name now check same name in maximo add/modify queue select your queue and check the jndi name........ Check the connection facility class in add/modify queues compare it with other queue whether it is requried / cusotmized or something delete data of your new queue(if it is not required else take backup or ask integration team to resend in case you have backup).. and now tr...