How to use the case for this query.

I got this name from the Employee table.
columns...

EmpId,
EmpType,
Join date,
Date of resignation

Now in EmpType it can be either 'P' OR 'C '.

So I want to check if the EmpTYpe is 'P' then joiningdate must not be null
and if the EmpType is 'C' then resignation date must not be null.

So only want to employee records.
Help, please.

Select * from employee
where (employeetype = 'c' and joinngdate is not null)
or (employeetype = 'p' and resigndate is not null)

Tags: Database

Similar Questions

  • I bought Lightroom 3 several years ago and have regularly updated through 5.  My new MacBook Pro has no dvd player.  How to make LR on my computer under my current license?  I don't want to use the cloud for this subscription.

    I bought Lightroom 3 several years ago and have updated regularly thanks to version 5.  My new MacBook Pro has no dvd player.  How to make LR on my computer under my current license?  I don't want to use the cloud for this subscription.

    Hi dw,

    You can download Lightroom 5 from the link below:

    Download Photoshop Lightroom

  • Any how to use the Cloud for business training

    As in the topic I'm looking for inspiration, examples, how to use the Cloud for his work.

    My organization is a training, coaching and HR solutions company. (If you are interesting in, welcome to [deleted by Moderator])

    I believe that such tools as a Cloud technology could training more effective and more attractive to the user in its form.

    Will be grateful for any suggestion

    Wik

    Hello

    Please see the pricing and membership creative cloud plans | Adobe Creative Cloud

    You can also attach sales to understand plans and benefits.

    Contact us | Adobe

    Hope that helps!

    Kind regards

    Sheena

  • How to use the case and decode to extract data

    Hello gurus of PL/SQL,.

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64-bit Production version

    I have a table in the following form-
    drop table TT2;
    create table TT2(College, Class,gender,status,fees) as select
    'IITB','MBA','M','P',255600 from dual union all select
    'IITK','MTech','M','P',300000 from dual union all select
    'IITD','MBA','F','P',450000 from dual union all select
    'IITKH','MBA','F','P',350000 from dual union all select
    'IITC','MTech','F','P',420000 from dual union all select
    'IITB','MTech','M','P',185000 from dual union all select
    'IITC','MTech','M','P',235000 from dual union all select
    'IITD','MBA','F','F',175000 from dual union all select
    'IITM','MBA','M','F',257000 from dual union all select     
    'IITKH','MTech','F','P',335000 from dual union all select
    'IITD','MBA','F','P',540335 from dual union all select
    'IITC','MBA','F','F',125089 from dual union all select
    'IITD','MTech','M','P',290756 from dual union all select
    'IITM','MBA','M','P',200000 from dual union all select     
    'IITKH','MBA','F','F',534990 from dual union all select
    'IITD','MBA','F','P',221000 from dual ;
    certain conditions of extraction are as follows-

    MATTER OF STATE
    College of 'IITB' and status = 'P'-'good WestRegion '.
    College of 'IITC' and status = 'P'-'good SouthRegion '.
    College 'IITD' and 'IITK' and status = 'P' and type = 'F' - 'female NothRegion spent.
    College not in 'IITK' and status = 'F' - 'Ex Kanpur Failed'

    Results-
    Region Statnding     Fees
    WestRegion Passed     440460
    SouthRegion Passed     655000
    NothRegion Female Passed     1386335
    Ex Kanpur Failed     1092079
    Used SQL
    I use the following query that only make sure of the case, but it's not how I want to exit, if I try to use the case to breast to decode then how to work on it.
    SELECT (CASE WHEN College in ('IITB') and status='P' then sum(fees) else 0 end) WP,
    (case when College in ('IITC') and status='P' then sum(fees) else 0 end) SP,
    (case when College in ('IITD','IITK') and gender='F' and status='P' then sum(fees) else 0 end) NFP,
    (case when College in ('IITK') and status='F' then sum(fees) else 0 end) ExKF
    FROM 
    TT2
    GROUP BY College, Class,gender,status
    SELECT CASE WHEN College in ('IITB') and status='P'
                        then 'WestRegion Passed'
                when College in ('IITC') and status='P'
                        then 'SouthRegion Passed'
                when College in ('IITD','IITK') and gender='F' and status='P'
                        then 'NothRegion Female Passed'
                when College in ('IITK') and status='F'
                        then 'Ex Kanpur Failed'
                else 'Others' end region_standing,
                sum(fees) fees
    FROM TT2
    GROUP BY  CASE WHEN College in ('IITB') and status='P'
                        then 'WestRegion Passed'
                when College in ('IITC') and status='P'
                        then 'SouthRegion Passed'
                when College in ('IITD','IITK') and gender='F' and status='P'
                        then 'NothRegion Female Passed'
                when College in ('IITK') and status='F'
                        then 'Ex Kanpur Failed'
                else 'Others' end;
    
  • How to use the DPS for a daily with as wordpress content management system

    Hello

    I use the DPS for magazines.  I would like to use urgent for a media company.  the content will be in the form of such as wordpress content management system, joomla.  I know that I can download html in pages content.  How can I display content such as the New york Times and the Washington post on iPad using digital publishing suites?

    Hello

    Please send me a private mail (ktukker at_sign adobe d o t - com) with your question and description of the workflow. Can you give me some links to sample from the Washington Post / NYT that you talk too much?

    You can associate a workflow HTML with DPS. Take a look at the application of Shell scenarios; content has all be created in the HTML articles.

    Shell scenarios: https://itunes.apple.com/nl/app/scenarios/id605820338?l=en&mt=8

    -Klaasjan

  • How to use the widget for payment? I was told that it was already in my library of widgets. But it's not.

    How to install the widget for payment? I was told that it was already in my library of widgets. But it's not.

    Hi, Edwina,.

    The default widget is paypal: How to add a PayPal button. Adobe Muse CC tutorials

    Or you can refer to Adobe Muse Widget Directory for third-party widgets.

    Kind regards

    Akshay

  • Need help to understand how to use the SDK for our use case

    Hi all!

    I'm having a lot of problems with understanding the SDK and how to work with it.

    The documentation available only is generated comments PHP which summarizes the methods, variables, about classes and groups.

    It is a reference that helps a little more on the technical aspect of the classes and their relationship with each other, but it IS NOT tell me, for example of one of the sample files:

    echo "-ch. |" -netmoref < netmoref > [choose] Vim portgroup MoRef. Required to create. \n » ;

    It's the example script that creates an external network, what I have to do to set up a new client, organization.

    Another unknown is what is a "fence Mode" in the present: $config-> setFenceMode ($fenceMode);

    Another concept of basis of the SDK I could not really grasp yet - is why some of the classes start as VMware_VCloud_API * while others are VMware_VCloud_SDK *.

    Another example? in the scree of new organization of the GUI, in terms of policy, there is a section 'Limits' - I searched carefully and found no corresponding SDK/API method in the documentation!

    Also, I couldn't find a way to delete organization (when a customer cancels a subscription, for example).

    I apologize if my attitude invades a bit on the angry side, but I was home for a while now and every time I get more irritated watching the "documentation" try to understand something

    Nevertheless, Kimberly Wang code is simply remarkable and very well written, just help to know how to make this huge puzzel I wish (even in the sample code that I do not understand how to find the right order of things in nesting objects in order to do something like object of class VMware_VCloud_API_OrgSettingsType for the parameters for example then feed him in a VMware_VCloud_API_AdminOrgType (as well as other parameters - why are they not in the $settings object? And finally another object of VMware_VCloud_SDK_Admin is to truly create the Organization!

    Why the VMware_VCloud_API_AdminOrgType couldn't be the class doing the creation of the Organization)?

    This is a brief summary of the things I'm trying to understand.

    Perhaps, I missed some sort of guide for this? and if not, I would be very grateful if someone could explain in a few words to help me to understand this puzzel so that I can start doing my work and build something out of these awesome (even if cryptic) building blocks!

    Thank you

    Sorry, you must use

    $SDKAdminOrgObj = $service-> createSDKObj ($adminOrgRef);

    It should return you a... Object SDK_AdminOrg.

  • How to display the values of this query? The type is XDB. XDB$ STRING_LIST_T

    Hi all

    If I run this query using a tool like developer PL/SQL (SQL window), the values are displayed as a Collection. Just click and see the results of the al.

    Select
    dbms_resconfig.getRepositoryResConfigPaths)
    Of
    Double;


    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    How can I do? With the help of the table? Create a type?

    TKS

    user12083350 wrote:

    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    SQL> select * from table(dbms_resconfig.getRepositoryResConfigPaths())
      2  /
    
    COLUMN_VALUE
    --------------------------------------------------------------------------------
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    7 rows selected.
    
    SQL> 
    

    And in PL/SQL:

    SQL> declare
      2      v_list xdb$string_list_t := dbms_resconfig.getRepositoryResConfigPaths();
      3  begin
      4      for i in 1..v_list.count loop
      5        dbms_output.put_line(v_list(i));
      6      end loop;
      7  end;
      8  /
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

    Published by: Solomon Yakobson, April 24, 2010 15:04

  • How to optimize the performance of this query SQL

    Hello

    I need to find the age for each day, but I need for all previous dates in a single query. So I used the following query:

    Select trunc (sysdate) - level + 1 DATE

    trunc (sysdate) - level + 1 - created_date AGE

    elements

    connect by trunc (sysdate) - level + 1 - created_date > 0

    I get output (FOR the DATE and AGE) that is fine and correct:

    DATE AGE           

    --------- ----------

    6 JULY 15 22

    5 JULY 15 21

    4 JULY 15 20

    3 JULY 15 19

    2 JULY 15 18

    JULY 1, 15 17

    JUNE 30, 15 16

    JUNE 29, 15 15

    JUNE 28, 15 14

    JUNE 27, 15 13

    JUNE 26, 15 12

    25 JUNE 15 11

    24 JUNE 15 10

    Now I need to calculate the average age for each day and I added the average in the following query:

    Select trunc (sysdate) - level + 1 DATE .

    AVG (trunc (sysdate) - level + 1 - created_date) AVERAGE_AGE

    elements

    connect by trunc (sysdate) - level + 1 - created_date > 0

    Group of trunc (sysdate) - level + 1


    This query is correct? When I add the aggregate (avg) function to this query, it takes 1 hour to retrieve the data. When I remove the average request function that gives the result in 2 seconds? What is the solution to calculate the average without affecting performance? Help, please

    Maybe you are looking for something like this...

    SQL > ed
    A written file afiedt.buf

    1 with t (point, created_date) :)
    2 Select 1, date '' 2015-06-24 from all the double union
    3 select 2, date ' 2015-06-29 the Union double all the
    4 Select 3, date ' 2015-06-17' of the double
    5        )
    6  --
    7. end of test data
    8  --
    9. Select item
    10, trunc (sysdate) - level + 1 as dt
    11, trunc (sysdate) - level + 1-created_date age
    12, round (avg (trunc (sysdate) - level + 1 - created_date) on (trunc (sysdate) partition - level + 1), 2) as avg_in_day
    13 t
    14 connect by level<=>
    15-point point = prior
    sys_guid() 16 and prior is not null
    17 * order by 1.2
    SQL > /.
    POINT DT AGE AVG_IN_DAY
    ---------- ----------- ---------- ----------
    1 JUNE 24, 2015 0 3.5
    1 25 JUNE 2015 1 4.5
    1 26 JUNE 2015 2 5.5
    1 27 JUNE 2015 3 6.5
    1 28 JUNE 2015 4 7.5
    1 29 JUNE 2015 5 5.67


    1 30 JUNE 2015 6 6.67
    1 1 JULY 2015 7 7.67
    1-2 JULY 2015 8 8.67
    1-3 JULY 2015 9 9.67
    1 TO 4 JULY 2015 10 10.67
    1 5 JULY 2015 11 11.67
    1 6 JULY 2015 12 12.67
    2 JUNE 29, 2015 5.67 0
    2 30 JUNE 2015 1 6.67
    2 1 JULY 2015 2 7,67
    2 2 JULY 2015 3 8.67
    2-3 JULY 2015 4 9.67
    2-4 JULY 2015 5 10.67
    2-5 JULY 2015 6 11.67
    2-6 JULY 2015 7 12.67
    3 JUNE 17, 2015 0 0
    3 18 JUNE 2015 1 1
    3 19 JUNE 2015 2 2
    3 20 JUNE 2015 3 3
    3 21 JUNE 2015 4 4
    3 22 JUNE 2015 5 5
    3 23 JUNE 2015 6 6
    3 24 JUNE 2015 7 3.5
    3 25 JUNE 2015 8 4.5
    3 26 JUNE 2015 9 5.5
    3 27 JUNE 2015 10 6.5
    3 28 JUNE 2015 11 7.5
    3 29 JUNE 2015 12 5.67
    3 30 JUNE 2015 13 6.67
    3 1 JULY 2015 14 7.67
    3 2 JULY 2015 15 8.67
    3 3 JULY 2015 16 9.67
    3-4 JULY 2015 17 10.67
    3-5 JULY 2015 18 11.67
    3 6 JULY 2015 19 12.67

    41 selected lines.

  • How to use the GPU for the AMD over-pants D500 in Mac pro 2013

    I install the first CC 2015 Pro and After Effect CC 2015 to 2013 with the graphics card AMD over-pants D500 Pro Mac, I can set GPU rendering in Premiere Pro, but impossible to define in the After Effect, only can use the CPU in the preview of the setting, how can I do?

    AE uses only a few NVIDIA CUDA enabled cards to speed up rendering drawn with RADIUS. This feature never quite worked, with disabilities masks and effects on layers 3D, and NVIDIA has changed the direction of their development of this technology for the Ray-traced rendering feature is is more developed by Adobe. They are working on another technology to use the GPU, but it is not yet available. There is nothing you can do to enable the GPU acceleration, unless you have a compatible NVIDIA card.

  • How to set the font for this SuperNova will display the text properly

    I have a problem with the use of Firefox with Supernova. Supernova is a program for the Visual disabled allowing you to enlarge the office. When you visit the page

    http://www.raadvanstate.nl/Uitspraken/zoeken-in-Uitspraken/Tekst-uitspraak.html?ID=73735 & summary_only =

    you will see orange colored text in the main text block. It appears correctly. However when I enlarge the screen with Supernova this orange text is barely readable due to the fact that the letters seems constructed points instead of a smooth line.

    Note that this happens even with this page where I enter these details of the issues. Supernove enlarged rhe screen, texts outside of the text box are horrible while the text in this text box is good.

    I ask this question here because when I use Internet explore this problem does not occur.

    I tried to make a screenshot, but the screenshot feature only "sees" the screen is enlarged. So when I zoom to 100% with Supernova, the text in the screenshot seems to agree.

    I realize that this is a difficult question to reproduce, but any help is welcome. Note that it is not a real option for me to enlarge the font with the Firefox options. Supernova expands the full screen, not only the text on the Web page. In this way, I am also able to see the menu / bookmarks of Firefox itself.

    Thank you very much
    Hans

    You can use an extension to set a page zoom and the size of the default font on the web pages.

    Try disabling hardware acceleration in Firefox.

  • How to use the trigger for Hammer

    Hello

    I used a hammer and an accelerometer of pcb to do some tests of beam. I want to express signal for start of log data after I use the hammer hit something. Here is my configuration in express signal.

    Trigger type: analog edge. Source of relaxation: the channel of the hammer
    Slope: fall. Level: 0

    However, once he began to run, it says "logging was stopped because an error occurred with a step in the project. If this error is due to a device buffer overflow, you can improve performance by disabling updates to screen using the "view > views of Signal update during the race" menu item. You can also change the way in which the signals are recorded by changing the Logging Options in the tools > Options dialog box. Disabling "Prepare the log for display data" will greatly improve performance. "I've changed everything, but it didn't work.

    Should I use other types of trigger?

    Thank you
    Ningyu


  • How to use the USB for adminstator password reset / need to update Java

    I need to update java NOW.  However; I don't know my password.  I tried to use a USB key, but it did not work.  I need simple, clear directions on how to reset my password.   I need to update JAVA NOW.  Thank you

    I need to update java NOW.  However; I don't know my password.  I tried to use a USB key, but it did not work.  I need simple, clear directions on how to reset my password.   I need to update JAVA NOW.  Thank you

    Hello

    If you created a password reset USB device when you create your password first, plug the unit into the machine when you do not enter the password and it will automatically log you on.

    Beyond that, we cannot help. This policy of forums to help us recover the passwords. This is due to the anonymous nature of the forums.

    Answers Support Forums password policy

    Keep secure passwords - Microsoft strategy on move the passwords

    Microsoft's official policy

    Microsoft's strategy concerning lost or forgotten passwords

    Concerning

  • How to use the validator for an inputtext inside the af: column

    Hi Experts ADF,

    Jdev version 11.1.1.7.0

    I created a datacontrol pojo based. And trained as a table in a jsf page. I have a column in which I have an inputText.

    Initially the inputText is a certain values as 0, 10 and 12 respectively.

    Now, I want the end user to change some values in this column and the validation range must be between 1 and 10000.

    But after using the validator if other lines have default values 0 then validation is triggered for all lines.

    Thank you

    AR

    Try to put the table in clickToEdit mode.

    Timo

  • Help: How to use the Case statement in the ODI11g Interface?

    Hello
    My basic source I get 'Year' values and I want that these values result code in the interface and after translation want to push on the target system.
    Example:
    Database source, I get value for
    Year
    2010
    2011
    2012

    When I get the year 2010 I want to change the value in "FY10".
    When I get year 2011 I want to change the value in "FY11.
    and even for the year 2012 to "FY12.
    I've tried to make the Case statement, but had no success.
    I don't want to create the lookup table in the source system.
    Any help in this matter.

    Thank you

    Concerning
    Sher

    Published by: Sher Ullah Baig on August 26, 2012 17:52

    CASE
    WHEN source_column = '2010' THEN 'FY10.
    WHEN source_column = '2011' and THEN 'FY11.
    WHEN source_column = '2012' and THEN 'FY12.
    END

Maybe you are looking for