How subquery works?

Hi All,
Can anyone explain different types of subquery and how it works?
With example would be great.
Thanks,
Kothan.

http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/expressi.htm#1656

Similar Messages

  • How to work even and odd number query

    Plz explain how below worked even and odd query
    2 ) why used subquery after from and which time we can use(what time of out put)
    even
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=0   
    odd
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=1

    Row_Number function returns the sequential number of a row
    (By using partition of a result set, starting at 1 for the first row in each partition)
    >> why used subquery after from and which time we can use(what time of out put)
    When we need sequntial numbers, we can use row_number function. Put it into derived table and use this derived table after FROM clause (Same way it is used in your query)
    CREATE TABLE stud_Enrollment (
    grno int,
    stud_id int,
    stud_name varchar(20)
    INSERT INTO stud_Enrollment
    VALUES (101, 511, 'Dheeraj'), (112, 521, 'Vaibhav'), (132, 522, 'Lalit'), (124, 564, 'Amogh'), (143, 598, 'Sushrut')
    SELECT * FROM stud_Enrollment
    -- Result of your table
    --grno stud_id stud_name
    --101 511 Dheeraj
    --112 521 Vaibhav
    --132 522 Lalit
    --124 564 Amogh
    --143 598 Sushrut
    -- Now we need to find out the rows which are at even position, ie row should be at position of 0,2,4,6,8 etc..
    -- But we don't have sequential number here in your table result
    -- So we can create one new column by using row_number function
    SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row, --> additiona "row" column
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment
    -- We got "row" column in below output
    --row grno stud_id stud_name
    --1 101 511 Dheeraj
    --2 112 521 Vaibhav
    --3 132 522 Lalit
    --4 124 564 Amogh
    --5 143 598 Sushrut
    -- Now above table is used after FROM clause. It uses row column in WHERE part
    SELECT
    FROM (SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row,
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment) d
    WHERE d.row % 2 = 0
    --row grno stud_id stud_name
    --2 112 521 Vaibhav
    --4 124 564 Amogh
    -Vaibhav Chaudhari

  • How to work with both desktop and Surface pro 3

    Hello,
    I have a desktop for my normal use of Adobe Creative Cloud for Photoshop and Lightroom.  I have my lightroom catalog on a separate external drive.  I just got Surface pro 3 to do Adobe on it.  I am now confused on how to work on Surface and how to access my Lightroom catalog.
    Thanks for your help.
    Mo

    Just install Lightroom on your Surface Pro, plug-in the external drive, and double-click the LR catalog file.

  • How to work with 360 video?

    I am new to AE and am trying to work with a 360 equirectangular video I shot with a Freedom 360 and 6 go pros.
    Are there any tutorials on how to work with 360 spherical videos? Do I need to download additional plugins?
    Thank you,
    Phil

    Phil,
    Of course, the image needs to be big for this, but the plugin you would use is CC Sphere.
    Drop your movie into a composition and apply CC Sphere to the video.
    Then set the Render option in the effect to "Inside".
    Under Shading set Ambient to 100% and Diffuse to 0%.
    Then scale inside the effect until the image fills the screen.
    Then you'll be able to use the Rotate Y controls in CC Sphere to spin around inside your video!
    You can also add Optics Compensation and Reverse the Lens Distortion to straighten out your image.
    Let me know if you have any questions!
    Trent

  • Hey Guys, from Germany. I want to connect my iMac 21" with my Tv just for fun. Does anyone know, how it works. With a Hdmi adapter?

    Hey guys! I want to connect my Imac 21 " with my Tv just for fun. Does anyone know , how it works?

    Selecting the correct adapter and cable depends on which year model iMac you have and what inputs the TV has?
    Check the User's Guide that came with your iMac or your Spec's at > Apple - Support - Technical Specifications
    to see if your iMac has a Mini-DVI or Mini DisplayPort and then select that adapter with the correct connection for the TV.
    Example: if you have a 2010 or 2011 iMac and an HDMI ready TV, then you would want the > Moshi Mini DP to HDMI Adapter with Audio Support - Apple Store (U.S.)

  • I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the thief logs out of iCloud. Would we able to locate the macbook?

    I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the person who has stolen my macbook logs out of iCloud.
    It should work fine for iPhone/iPad because we can enable "Restrictions" to prevent the user from signing out of iCloud. Do we have simialr settings for the macbook?
    Thanks,

    If it's not on the device list, it indicates that someone has gone to Find My iPhone on icloud.com and manually deleted it from the device list (as explained here: http://help.apple.com/icloud/#mmfc0eeddd), and it has not gone back online since (which would cause it to reappear on the device list; Find My iPhone has been turned of in settings on the device; the iClolud account has been deleted from the device; or the entire devices has been erased and restored.
    Unfortunately, there's no other way to track the phone other than through Find My iPhone.  You could call your carrier and see if they would blackliste it so at least the theif couldn't use it.

  • I need to change my apple ID because I'm changing my email address. I'm worried that when I do, I'll no longer be able to use my first generation apple tv unless I change the apple ID there as well.  Does anyone know how this works??

    I have to change my apple ID because I'm changing my email address. (I have a Comcast address and am switching to U-verse) I'm worried that when I do, I'll no longer be able to use my first generation apple tv unless I change the apple ID there as well. I'm also trying to find out if changing my apple ID is going to interfere with getting my itunes content on my computer and my iphone.  Does anyone know how this works??

    My iTunes appleID is an old defunct e-mail address - it does not have to be functional.
    Do what Winston says to ensure you keep getting correspondence related to that ID.
    AC

  • HT3209 how many times i can watch the show after i purchased on i tune and how this works

    I was just wondering if sombody can help me with this because i am new to itune  . I would like to know how it works after u purchase tv show , do i have to pay once and watch more time or i have to pay every time i watch . Thank you in advance .

    I was just wondering if sombody can help me with this because i am new to itune  . I would like to know how it works after u purchase tv show , do i have to pay once and watch more time or i have to pay every time i watch . Thank you in advance .

  • On my ipod touch I'm not too sure how I uploaded a album onto my ipod from my laptop. But, now there is no way to delete the album full of pictures. What do I do? I only gotten it a while ago and not fully sure how to work it. Help?

    On my ipod touch I'm not too sure how I uploaded a album onto my ipod from my laptop. But, now there is no way to delete the album full of pictures. What do I do? I only gotten it a while ago and not fully sure how to work it. Help?

    http://support.apple.com/kb/HT4236

  • I no longer have access to my icloud email and don't know the answers to my security questions. Does anyone know how to work around this to reset my icloud ID without losing my info? I haven't backed up in a year because of this.

    I no longer have access to my icloud email and don't know the answers to my security questions. Does anyone know how to work around this to reset my icloud ID without losing my info? I haven't backed up in a year because of this.

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (123381)

  • I pad 2 updated to iOS 6.1.3 and now wifi is greyed out. Apple support engineers say replace but my warranty exited 09/12. Funny how it worked perfectly fine before the update.

    I just updated to6.1.3 and now my wifi button is greyed out. Apple support said it is a hardware issue. Funny how it worked just fine on the previous iOS. Now apple wants me to buy a replace not because my warranty expired 09/12. Seems to me like ios6.1.3 was an update to sell more products. Tried all suggested fixes with no success. With all the noted issues with ios6 there may be another class action lawsuit coming. Apple tech senior advisor unwilling to help. First advisor told me just buy a new I pad. Second advisor wants me to pay for a replacement. Can someone explain to me how an apple approved software upgrade that damaged my i pad is classified as my fault. I've seen some shady selling techniques but this one takes the cake in my book. Anyone have the contact information to higher up executives in apple for me to speak with about my issues?

    Have you check the following?
    Verify that airplane mode is off by tapping Settings > Airplane Mode.
    Reset the network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings
    Ensure that your device is using the latest software.
    If your issue is still unresolved, perform a software restore in iTune

  • How IE works for  flat file

    Hi all:
         As we all know that, when IE gets a idoc's service name from SLD, then use it with idoc's message type and Idoc type to do receiver determniation, what about flat file ? how can we know its Service name and interface name  if there is only a flat file on FTP?  how IE works for Flat file ?
         Couldn't thank you more

    Hi,
    For any idoc scenarious, you would use business systems rather than business service which is stored in SLD. So the IE would fetch it from SLD at runtime.
    For file based scenarious also, you can create business system as type third party and use the same.
    Is that answer your question?
    Regards
    Krish

  • Better process for introducing new features and explaining how they work

    There are all kinds of new features being added to the Creative Cloud app but knowing what they are and learning about how they work isn't the most user friendly process. The current process is read the release notes after updating to a new version. The release notes should hyperlink to the related features in the product help. It would be great if there was a "What's New" section for the Creative Cloud app itself with new releases which included an introduction to new features just like there is for the desktop products.

    This is a poorly explained reason about why is so important having a loupe in Photoshop. I've not also, used the best example, but I will. This belongs to the ADDITIONAL FEATURES: Loupe/Magnificator View:. Also, I will try to make my english clrearer, but here it goes:

  • How does works default parameters in a program with logical database PNP?

    Hi Friends,
      I have a basic program, i need to filter info with period parameters in a program that uses logical database PNP, but it doesn't work.
      If i use "person selection period" that it's suposed to filter info according to infotype 0001 (as the sap help says), it doesn't work, i use: PNPBEGPS = today and PNPENDPS = today, and the result it's a lot of registers that doesn't meet that criteria.
      Also i tried with: data selection period, today, up to day, current month. And the result it's with the same problem.
      How does works period parameters in a program with logical database PNP?
    This it's the program example, i use the default category.
    REPORT  ZRPHRTEST.
    tables: pernr.
    infotypes: 0001.
    start-of-selection.
    get pernr.
      write: pernr-pernr, p0001-begda, p0001-endda.
    end-of-selection.
    write 'fin'.

    Hi,
    Define pernr table under tables statement then and use GET PERNR event.This get event is followed by End-Of-Selection.
    Syntax: Tables pernr.
                Get pernr.
    Try, activate and test. This should solve your problem.
    Regards,
    Abhijeet

  • How to work with EEWB tool in CRM and how to assign it to PCUI

    Hi Friends,
    Can any body will suggest me how to work with EEWB tool in CRM to add new fields ,i need to attach the fields to a GUI screen and same to PCUI also,
    And how to attach a search help for those fields,is the tool will automatically will create the search helps or it is similar as we do in abap,
    So can any body suggest me to get a material on this ,
    Thaking you
    Regards
    Raghavendra Prasad

    Prasad
    Following are the steps involved in general :
    1. Select the filter Worklist and enter your name in the input field of the object list selection. Press the enter key. Your object list is displayed.
    2. Place your cursor on the highest node(PROJECT BY XXXXXX). Select Create project from the context menu by right-clicking on it. You see the dialog box Create project.
    3. Enter a project name, description, packages, and namespaces for each system used. Leave the dialog box by pressing the enter key.
    Specify transport requests. The Project is created and appears in the object list.
    4. Place your cursor on the new project in the object list and select Create extension in the context menu. You see the dialog box Create extension.
    5. Enter a name and description. Define a Business Object and extension type. Press the enter key.The extension is created and appears in the object list below the project.
    6. Place your cursor on the new extension in the object list and select Call wizard in the context menu. The wizard for the extension action starts automatically.
    7. Fill in the input fields following the notes on screen and end the wizard by clicking on Complete.The extension tasks have been created and appear in the object list.
    Project and extension are created !
    Also take care that you have the Transport Requests and Save the Project and Extensions against a Development Class !
    In general , EEW will automatically puts the fields on the Screen. We donot want to worry abt that !
    The generated BADIs can be implemented to do some Checks(for example) !
    I hope this helps !
    Thanks
    <b>Allot points if this helps !</b>

Maybe you are looking for

  • Why are my mp3's and m4a files no longer recognized?

    All of a sudden, 95% of the 10,000 music tracks in my iTunes Library has become unplayable. It concerns mp3 and m4a files with music that I purchased and ripped over the years. Wifi syncing to my iPhone 4s made it worse: now the Music app on my iPhon

  • Urgent help with Rented song not transferring to Classic

    Hi Please help. I just purchased a rented movie from itunes but everyone time i try transferring it onto my 120Gb Classic a notice pops up saying "The Ipod cannot be synced. The required folder cannot be found." But i just read the manual and it says

  • Exclude values in infopackage

    Hi Firends I have an infopackage and the following data slections. company code profit center now i want to exclude few profit center values at the time of loading. can any one explain how we are going to do this. Regards Sundaresan

  • How can I change default build time from 1 sec to .5 sec?

    Whenever I create a build, the default time is 1 sec. I'd like it to be .5 sec. I use a blank master slide. How can I change the default build time for all slides? Or can I?

  • I'm having trouble with installing Adobe Flash Player

    everything I using on the web tells me I need the update for Adobe Flash Player-birthday cad sites and such... So I install it but instead of just finishing step 3 - install complete - I get an advertisement for an additional application for $9.99 a