Suppose I have a table emp that has thousands of lines of data. In this table, I have to get only the employees whose salary is equal.

Hello world

Suppose I have a table emp that has thousands of lines of data. In this table of employees receive wages between 1000-10000.

Now I have to get only the employees whose salary is equal.

for example

empNo empName sal

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

1 ram 5000

2 5000 Shyam

3 1000 Dilip

4 deepak 2000

5 sisi 1000

6 1000 Priya

so now...

Now without using ' select * from emp where Sal IN (5000,1000). "How can I get these employees with the same salary?

SELECT *.

EMP e1

WHERE EXISTS (SELECT 99 FROM emp e2 WHERE e2.sal = e1.sal AND e2.empno! = e1.empno)

or maybe

SELECT *.

WCP

WHERE sal IN (SELECT sal FROM emp GROUP BY sal HAVING COUNT (*) > 1)

Tags: Database

Similar Questions

  • When I launch Firefox, I get only the bottom of my browser in the Firefox window. I have already reinstalled it, but it does not solve the problem.

    When I launch Firefox, I get only the bottom of my browser in the Firefox window. I have the normal window for 1 second, but it changes in the background window only. So, without the toolbar or navigation. I have already reinstalled it, but it does not solve the problem.

    Hello jonson00, please follow the troubleshooting steps in Firefox opens with a white or transparent window. If this solves the problem, it would be also interesting including the extension has a problem in your case. Thank you!

  • I can't open a folder that has about 350 GB of data in it. It gives me an error cannot open due to IO error

    I tried to do a system restore but it used to quote the error and I tried to defrag the drive but it is stuck at 10%, again citing the files error that is impossible to open the folder or recreate due to IO error.

    Gina,

    This is much like a directory corrupted on your hard drive.  If you have not yet tried, check for errors on your hard disks with a 'chkdsk/f'  Your external readers should check interactively.  Your system startup disk will require a reboot of the system and will be checked offline.  This is a normal maintenance procedure and should be performed periodically.  Note: Large capacity disks can take hours to check.

    "How to perform disk error in Windows XP check"
      <>http://support.Microsoft.com/kb/315265 >

    HTH,
    JW

  • for some reason any bar that has firefox and a down arrow left and I would like to get it back

    for some reason any bar that says firefox with an arrow down on the top browsers disappeared and I don't want to return

    I fixed it

  • Get only the users that correspond to all the links

    Apparently a very simple problem, but I can't seem to understand.

    Below is a table that contains the user's and LinkId name.

    CREATE TABLE UserLink (UserId NUMBER, LinkId NUMBER );
    ALTER TABLE UserLink ADD PRIMARY KEY (UserId, LinkId);
    INSERT INTO UserLink VALUES (1, 1);
    INSERT INTO UserLink VALUES (1, 2);
    INSERT INTO UserLink VALUES (3, 1);
    INSERT INTO UserLink VALUES (4, 1);
    
    
    
    

    I am looking for a query in which I can plug a LinkId list that shows only users who have a relationship with of all THE LinkId condition.

    In this example, you can assume that the list is equal to (1, 2), but you can not make all the assumptions concerning the size of the list, except the size! = 0.

    The query to search for users that match to THE provided LinkId is quite simple:

    SELECT UserId FROM UserLink
    WHERE LinkId IN (1,2)
    
    
    
    

    The correct query should output:

    USERID
    ------
    1
    
    
    
    

    And it should work for any > 0 see size of values.

    Here's one way:

    with ID_LIST as (select 1 LINKID from DUAL union all select 2 from DUAL)
    select distinct USERID from USERLINK a
     where not exists (
                      select LINKID from ID_LIST
                      minus
                      select B.LINKID
                        from USERLINK B
                       where B.USERID=a.USERID
                     )
    ;
    

    11 g here's a different way using UNPIVOT to generate the list of link IDS.  It is perhaps less bulky than a long list of UNION all.

    with ID_LIST as (select  1 a,2 b from DUAL)
    select distinct USERID from USERLINK a
     where not exists (
                      select LINKID from ID_LIST UNPIVOT (LINKID for COL in(a,b))
                      minus
                      select B.LINKID
                        from USERLINK B
                       where B.USERID=a.USERID
                     )
    ;
    
  • Firefox has crashed on the desktop. Get only the black screen, taskbar with icons and hourglass cursor of the mouse on the taskbar. Windows 10.

    I tried to restart Firefox, nothing helps. Then I tried to restart my desktop computer Dim screen with taskbar with icons, hourglass cursor that does nothing on tasckbar only. I tried to close everything down and restart - without success. I write from my laptop, the problem is on my desk - Hewlett-Packard, 2-3 years, running windows 10. Only one prior occasion when Firefox crashed. Restart of Firefox took care of the problem and has been fine since.

    Contact a computer repair. It seems that the system files are corrupted.

  • I have a desktop computer with Vista business I want to upgrade to Windows 7 and install Vista on a laptop that has XP Pro but is Vista capable.

    Transfer Vista Business on XP Pro computer.

    I have a desktop computer with Vista business I want to upgrade to Windows 7 and install Vista on a laptop that has XP Pro but is Vista capable.

    Hello

    If you use the Vista licence as part of the upgrade to Windows 7 you cannot use the license of Vista anywhere elsewhere

    It is part of the upgrade process

    and also read this on licensing rules;

    If Windows was preinstalled on your computer, Dell, HP, etc., or you bought an OEM/license disk, they are both classified as an OEM license and are not transferable.

    The Windows OEM license is linked to the original computer it is installed on and dies with the computer.
    You cannot transfer it to another computer/laptop

    If a retail Windows license, you can transfer it to another computer/laptop.
    But it can only be installed on one computer at a time.

    A single license is a single Installation.

  • Help to extract data Clob to a column in a table that has several lines in a table

    Help to extract data Clob to a column in a table that has several lines in a table

    It works for only the first line

    CREATE or REPLACE DIRECTORY XMLDIR AS ' / orabackups';

    Grant read, write on DIRECTORY XMLDIR to the public;

    () dbms_xslprocessor.clob2file

    beef in CLOB,

    XMLDIR IN VARCHAR2,

    "testfile2.txt" IN VARCHAR2);

    DECLARE

    buf CLOB.

    BEGIN

    SELECT H15_DOC

    IN buf

    OF H15TEST. H15_STAGE

    where rownum = 1;

    dbms_xslprocessor.clob2file (buf, 'XMLDIR', 'testfile2.txt');

    END;

    /

    -This error code

    CREATE or REPLACE DIRECTORY XMLDIR AS ' / orabackups';

    Grant read, write on DIRECTORY XMLDIR to the public;

    () dbms_xslprocessor.clob2file

    XData in CLOB,

    XMLDIR IN VARCHAR2,

    "testfile2.txt" IN VARCHAR2,

    CSID in NUMBER: = 0);

    DECLARE

    CURSOR xmlmycur IS SELECT H15_DOC

    OF H15TEST. H15_STAGE

    where rownum = 102140;

    l_clob CLOB.

    XData CLOB.

    BEGIN

    DBMS_LOB.CREATETEMPORARY (l_clob, true);

    DBMS_LOB.CREATETEMPORARY (xdata, true);

    OPEN xmlmycur.

    LOOP

    SEEK xmlmycur INTO xdata;

    dbms_xslprocessor.clob2file (xdata, 'XMLDIR', 'testfile2.txt');

    EXIT WHEN xmlmycur % notfound;

    END LOOP;

    CLOSE Xmlmycur;

    END;

    /

    ORA-21560: 3 argument is null, invalid or out of range

    ORA-06512: at "SYS." DBMS_LOB", line 991

    ORA-06512: at "XDB". DBMS_XSLPROCESSOR', line 324

    ORA-06512: at line 15 level

    FYI, it seems that the file being created will exceed 5 gig

    Yes, it is a known issue with DBMS_XSLPROCESSOR.clob2file with big files.

    Here is a slightly modified version of the code that I posted earlier, fixing WRITE_ERROR except:

    DECLARE

    v_file utl_file.file_type;

    -write a unique to clob

    procedure write_clob (p_content in clob) is

    v_buffer varchar2 (32767).

    V_POSITION pls_integer: = 1;

    v_amount pls_integer: = 32767;

    Start

    loop

    Start

    DBMS_LOB. Read (p_content, v_amount, v_position, v_buffer);

    exception

    When no_data_found then exit;

    end;

    UTL_FILE.put_raw (v_file, utl_raw.cast_to_raw (v_buffer), true);

    V_POSITION: = v_position + v_amount;

    end loop;

    end;

    BEGIN

    -Open the file

    v_file: = utl_file.fopen ('TEST_DIR', 'testfile2.txt', 'wb', 32767);

    -loops through the lines

    for r in)

    Select h15_doc

    of h15test.h15_stage

    )

    loop

    write_clob (r.h15_doc);

    end loop;

    UTL_FILE.fclose (v_file);

    END;

    /

  • How to restore a list of e-mail contacts that has been hacked and deleted?

    Have a long-established AOL Mail contact that has several addresses of hundreds who failed this afternoon after a phishing e-mail has been sent to my contacts list. Is it possible to retrieve this list?

    Hello skrub, you post to the support forum for firefox - firefox is a browser and does not handle your email so that we will not be able to help you with third-party services. Please contact your e-mail instead, provider to help you with this question...

    Problems with email and how to find help

  • can I create a DLL file for labview that has DLL library with inside?

    Hello everyone,

    I am developing an application for the cards PCI devicenet in labview (beginner to labview) environment.  Is there a DLL file for the PCI card from the provider. But it's too complicated for a beginner to call each function in the DLL of labview. Therefore, I'm trying to re - use a VC ++ program (working properly) that calls some sellers DLL library functions.    To do this, I created the DLL file which includes all headers and libraries the provider DLL, as indicated in the attached figure. But I couln can't see the effect on the device. is it possible to create a DLL file for labview that has DLL library with inside? If this is not the case, how can I implement the program shown in figure?

    I would like to wish a huge as to advance.

    It is not something I have a lot of experience in so I don't know all the details of the restrictions or requirements etc - but it is certainly possible to create wrappers for the dll and then use them in LabVIEW - this is sometimes necessary to convert some native types/data structures in C/C++ into something that you can switch to your other DLL LabVIEW.

    There is a link here: http://digital.ni.com/public.nsf/allkb/06ECDC689DDA0F3D862574440074CD95

  • When you print a document that has an image in it, it does not print the photo

    Title problems: printing Moose

    When you print a document that has an image in it, it prints the image - all programs such as Word, Publisher, PDF, etc. Printer works ok with another computer and another printer works well with the computer. Have reinstalled the printer driver - downloaded from HP. I've updated to Windows Vista. The printer is a HP Photosmart 3210xi all-in-One. Nobody has been able to help me on this one.

    Hi Karosel

    The document which you are referring?

    Given that the issue is limited to a specific document, he could some settings within the program that causes this problem.

    Check print photo in the program settings, and then test to see if you can print as expected.

  • Just upgraded to Mac OS 10.11 and may not reduce the size of the document. A size of message says I don't have permissions. I think it has to do with SIP, but how this problem is corrected?

    Just upgraded to Mac OS 10.11 and cannot reduce a document. A message from Acrobat Pro says that I don't have permissions. I think it has to do with SIP, but how this problem is corrected?

    Zapped the PRAM and Acrobat Pro works now.

    ===================================

  • What is confirgaration 213:11 error occurring during the opening of adode software that has already been installed

    What is confirgaration 213:11 error occurring during the opening of adode software that has already been installed

    Hello

    This error appears when you don't have access to read/Wrire in file required to run Software (SlStore)

    > Try to run the Application as administrator (right click on the Adobe application and select run as administrator)

    > See

    Error "license store does not allow writing | Install log | CS5, CS5.5

    > Meanings must solve if it does not reinstall the Application

    Let us know if this helps

    ~ Assani

  • is it possible that I can work on a movie published in the latest version of first with a first CC 2015 version that has not been completely updated?

    is it possible that I can work on a movie published in the latest version of first with a first CC 2015 version that has not been completely updated?

    I m edition trailer of friends, but the very first version is not fully updated, so it does not recognize the project... Is it possible to fix this?

    There is no way to go "in time" and do older versions of body include the latest versions of the project file format.

    Sorting is to get your current version.

  • Table is not correctly displayed in the browser

    Hello
    I have set up tables on a page in DW8 that has good color and spacing between cells. When I save and preview in the browser it does not display properly. It seems better IE than Firefox, but neither one is right. I redid page two maybe three times with the same results... Here is the page in question.
    I work in design mode because I have not yet learned HTML... Could it be part of my problem? I recently upgraded to DW4 and don't remember having this problem before...
    I'd appreciate any help that you people could offer!
    RC

    Hi Gary,.
    Which "interesting that the tables seem correct in your browser... On my computer, IE and Firefox show the central image off center with a larger space on both sides of it.
    I'll try to work through these tutorials and see if I can get a little html smarts...

    Thank you very much for all your comments... I'll see you on the Forum.

    RC

Maybe you are looking for

  • Under Score _ on BDP-S580 Blu Ray

    I use a Logitech Harmony One universal to write the URL on the Blu Ray remote.Some of the Internet Radio Stations use under Score _ as part of their URLThat is why I am unable to enter their URL Someone has solved this problem?

  • Satellite A305 keeps restarting

    I have a Satellite A305-s6857.Windows xp 64 bit vista. This is what is happening, please bare with me it gets really confusing. Laughing out loud My laptop keeps restarting on its own.at first I thought it was overheating - so I downloaded SPECCY and

  • Unable to connect to Hotmail account as the password is expired.

    original title: Greetings from John Nelson! Greetings from John Nelson! When I reset my password to my Hotmail emailE-mail address is removed from the privacy *. I must have clicked on the button that reads please stopthe use of this password after 7

  • Installed xp on my vaio Boulaye vg-fz40e and now need drivers... where can I get drivers for my laptop?

    Installed xp on my vaio Boulaye vg-fz40e and now need drivers... where can I get drivers for my laptop?

  • When exactly PersistentStore get deleted?

    I've seen this issue mentioned in http://supportforums.blackberry.com/t5/Java-Development/Best-Practices-for-Storing-Application-Confi... but I would ask explicitly.  So I'm not actually remove objects from PersistentStore, when and how are they dest