Using a different offset from 1 in the function LEAD does not seem to work.

Hi,
I have the following rows in a table:
SQL> select job_id from jw_exception_accesses
2 where rownum < 11
3 order by job_id;
JOB_ID
442484177
443178279
443178279
443357232
443443617
443536258
1. When I try and use the offset of 2 with the LEAD function, it brings back nothing.
SQL> select job_id,lead(job_id,2) over (order by job_id) as next_job
2 from jw_exception_accesses
3 order by job_id;
JOB_ID NEXT_JOB
442484177
2. When I try and use the offset of 1 with the LEAD function, with rownum, it
brings back nothing:
SQL> select job_id,lead(job_id,1) over (order by job_id) as next_job
2 from jw_exception_accesses
3 where rownum < 2;
JOB_ID NEXT_JOB
443618290
3. When I try and use the LEAD function with a particular row as the current row,
it brings back nothing:
SQL> select job_id,lead(job_id,2) over (order by job_id) as next_job
2 from jw_exception_accesses
3 where job_id = 421624348;
JOB_ID NEXT_JOB
421624348
4. When I try and use the MIN function, to just get one row back, it brings
nothing back.
SQL> select min(job_id),lead(min(job_id),1) over (order by min(job_id)) as next_job
2 from jw_exception_accesses;
MIN(JOB_ID) NEXT_JOB
421624348
OR
SQL> select min(job_id),lead(job_id,1) over (order by job_id) as next_job
2 from jw_exception_accesses
3 where rownum < 2
4 group by job_id;
MIN(JOB_ID) NEXT_JOB
443618290
And yet manuals say you can use a particular row as the launching row.
Any ideas anyone?
Thanks very much for any help.
- J

Hi,
user1636556 wrote:
... 1. When I try and use the offset of 2 with the LEAD function, it brings back nothing.
SQL> select job_id,lead(job_id,2) over (order by job_id) as next_job
2 from jw_exception_accesses
3 order by job_id;
JOB_ID NEXT_JOB
442484177
MIN(JOB_ID) NEXT_JOB
443618290It works fine for me:
SELECT       ename
,       LEAD (ename, 2) OVER (ORDER BY ename)     AS lead_2
FROM        scott.emp
ORDER BY  ename
;Ouptut:
ENAME      LEAD_2
ADAMS      BLAKE
ALLEN      CLARK
BLAKE      FORD
CLARK      JAMES
FORD       JONES
JAMES      KING
JONES      MARTIN
KING       MILLER
MARTIN     SCOTT
MILLER     SMITH
SCOTT      TURNER
SMITH      WARD
TURNER
WARDNotice that LEAD does return NULL near the ned of the result set, when there are not 2 later rows.
Post a complete test script that people can run to re-create your problem. Include CREATE TABLE and INSERT statements for your tables (unless you're using commonly available tables, like those in the scott or hr schemas).
Post the results you want to get from that data.
2. When I try and use the offset of 1 with the LEAD function, with rownum, it
brings back nothing:
SQL> select job_id,lead(job_id,1) over (order by job_id) as next_job
2 from jw_exception_accesses
3 where rownum < 2;
JOB_ID NEXT_JOB
443618290
3. When I try and use the LEAD function with a particular row as the current row,
it brings back nothing:
SQL> select job_id,lead(job_id,2) over (order by job_id) as next_job
2 from jw_exception_accesses
3 where job_id = 421624348;
JOB_ID NEXT_JOB
421624348
4. When I try and use the MIN function, to just get one row back, it brings
nothing back.
SQL> select min(job_id),lead(min(job_id),1) over (order by min(job_id)) as next_job
2 from jw_exception_accesses;
MIN(JOB_ID) NEXT_JOB
421624348
OR
SQL> select min(job_id),lead(job_id,1) over (order by job_id) as next_job
2 from jw_exception_accesses
3 where rownum < 2
4 group by job_id;Analytic functions are computed after the WHERE clause is applied. If the WHERE clause narrows the result set down to n rows, then LEAD (x, n) will always return NULL.
Analytic functions are computed after the GROUP BY clause, too, so you can use analytic functions in a GROUP BY query, but only using expressions that would be legal in the SELECT clause (aggregates, the GROUP BY columns, and constants).

Similar Messages

  • When I print to PDF using Acrobat 11 Pro from any application the acrobat Reader does not launch automatically. Associations are correct. Thx for your help,  Bruce

    When I print to PDF using Acrobat 11 Pro from any application the acrobat Reader does not launch automatically. Associations are correct. Happens from Chrome, IE, Word, Excel, Powerpoint. Previously had deskPDF installed but uninstalled correctly. Can't find a preference setting for the auto launch. Thx for your help,  Bruce

    A simple way is to flatten the form fields, which converts the field appearances to regular page contents. You can do this with JavaScript or PDF Optimizer (Advanced > PDF Optimizer > Discard Objects > Flatten form fields). A very nice script that adds a custom menu item can be found here: http://www.uvsar.com/projects/acrobat/flattener/

  • HT5343 Resetting the DNS cache does not seem to work on OS X 10.8, what does really work?

    Resetting the DNS cache does not seem to work on OS X 10.8, what does really work?
    Desired activity: access a site that used to not have a SSL connection through the new https:// root domain. I can accomplish the task over a machine running Windows 7 or XP but flushing the dns of my mac does not affect the outcome — I am still redirected to the hosting provider's website whenever I tried to access the domain with a https:// prefix rather than http://
    I tried sudo killall -HUP mDNSResponder and it's older alternative but no luck.

    In the terminal:
    dscacheutil -flushcache
    and to get a very detailed report on the state of your DNS cache in /var/logs/system.log:
    sudo killall -INFO mDNSResponder

  • In FF4 the opensearch detection does not seem to work. how can I add a search engine , that has an opensearch xml but no plugin?

    if you go to a webpage with an opensearch link tag like "&lt;link rel="search" type="application/opensearchdescription+xml...." FF3.x highlighted the small arrow left of the search box and you could add the search engine. this does not seem to work in FF4.
    If a searchengine for example for the intranet, does not offer a plugin, just the opnesearch xml, how can one add it to the search engines in FF4?

    You do not get the blue glow on the search engine icon in Firefox 4, but you should still see the "Add ... site" entry in the menu if you click the search engines icon on the Navigation Toolbar.

  • Crystal 8.5 (Minimum function in the function tree does not appear to work)

    HI I would greatly appreciate some help with this problem I am having.
    I am creating a report in which there is a group of records printed . Within each record there could be any number of results related to that record of which I want to extract both the maximium and minimum value and print these. This bit is fine as I do this using the maximum and minimum function available within the summary function.
    However with each of these max and min values calculated and printed I then want to create a footer that adds all these max and min values up. (This is not immediately possible using the 'summary function' max and min values as they are not presented on the 'Field explorer' dialog box for selection.
    However I can individually using the maximum 'tree function' get the report to store these values so that I can do the calculations once I have got to the footer (as the  fields defined are accessible through the field explorer. But the same minimum function does not appear to extract a result (and no I do not have zeros in the data).
    Is there a known problem with the minimum function?
    Is there another way of getting this data?
    Thank you in advance
    seyviv

    Hi Debi, it would be easier for mean to demonstrate what I wnat/am doing in the report by use of data.
    I have a file with a list of sample results. There may be many results for one sample. ie
    Sample      Result Number      Result
    98-01          1                           3
    98-01          2                           5
    98-01          3                           6
    98-02          1                           3
    98-02          2                           7
    98-02          3                           9
    98-03          1                           4
    98-03          2                           5
    98-03          3                           11
    On the first page I want to see the max and min values across all samples listed for each result number. Then as a total value (once all the result numbers max and mins are displayed I want to perform a calculation on the max and min values displayed in the list (ie. max 4 + 7 -11  and for min 3 + 5 - 6)  
                          Result 
                          Number        Max           MIn 
                          1                    4                3
                          2                    7                5
                          3                    11              6
    Result of                             0                2
    Calculation
    I have been able to do this for the max values but the minimum function does not work.
    How I currently extract this data is that I use a 'Summary field ' to calculate the max and min values in the list. However to get the data for the calculation at the bottom I use the 'Formula fields' to extract the values listed for all the results for 'result number 1, 2 & 3' and then use the 'Function tree' to get the 'Maximum value for each individual result number and then finally do a calculation on the max values. However, the same minimum function does not appear to work.
    I hope this explains what my problem is.
    Thank you in advance of any suggestions you may have
    Regards
    Viv

  • How come rescaling "the katies website" does not seem to work in the browsers as it does on the videos that go withe the excercise?

    browsers used:
    Firefox , Chrome and Iexplorer
    When rescaling the browser windows, eg the salad menu picture as used in katies website is not joining in rescaling the browsers?

    Are you referring to menu on the page ? any any other specific content ?
    Any content used as 100% browser width will work fine with browser resize, if you are not getting the same behavior , please provide the link to the page so that we can have a look.
    Thanks,
    Sanjit

  • The search feature in messages does not seem to work with pre IOS 7 messages

    After updating to IOS 7 the search feature in the Messages app does not seem to work with messages received prior to the update.  Texts received since the IOS 7 update search correctly.  Is this a bug or a feature of moving to iMessages rather than just receiving standard texts?

    Although not related to your question you have outdated ShockWave Flash Player go ahead and update your flash player by going to www.get.adobe.com/flashplayer
    As for your problem, One of your add-ons might be the culprit too. Try running Firefox in [[Safe Mode]] with all add-ons disabled. If that solves the problem, see [[Troubleshooting extensions and themes]] and possibly [[Troubleshooting plugins]]

  • Using the content aware move tool, I want to move an item from one image to another image but it does not seem to work. I think I need two layers on one document so how do I do this

    Using the content aware move tool, I want to move an item from one image to another image but it does not seem to work. I think I need two layers on one document so how do I do this

    Good day!
    A simple Paste does not work for you?
    It should place the clipboard content as a new Layer which you can then move around.
    If there is any chance that the elements need to be scaled, rotated etc. I would prefer to place them as Smart Objects (File > Place …) and do the masking that is specific to the images themselves in those.
    Regards,
    Pfaffenbichler

  • I bought this ipod 4 from a friend the lock button does not work and he doesnt know the password? how do i reset and i cant use my computer????   HELP!!!!!!

    i bought this ipod 4 from a friend the lock button does not work and he doesnt know the password? how do i reset and i cant use my computer????
    HELP!!!!!!

    Place the iOS device in recovery mode usning this program and then then restore via iTunes. The iPod will be erased.
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    For how to restore:
    iTunes: Restoring iOS software

  • Hi, since installing mountain lion on my macbook, it wont download pdf files from internet sites, the same problem does not exist on my mac mini, i am using firefox on both macs, please help!

    Hi, since installing mountain lion on my macbook, it wont download pdf files from internet sites, the same problem does not exist on my mac mini, i am using firefox on both macs, please help!

    Back up all data.
    Quit Safari. In the Finder, select Go ▹ Go to Folder... from the menu bar, or press the key combination shift-command-G. Copy the line of text below into the box that opens, and press return:
    /Library/Internet Plug-ins
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then launch Safari and test.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • I'm attempting to create a pdf from InDesign and the Illustrator image does not appear properly.

    I'm attempting to create a pdf from InDesign and the Illustrator logo does not appear properly. The logo has a light blue color background with a black to white gradiant over it with a multiply designation set at 100%.  I flattened the logo in illustrator before importing into InDesign. When the pdf is created, the blue background of the logo drops out and the only thing showing is the graduated screen of black. PLEASE HELP!!!!!!

    Thanks for your reply Peter,
    I'm on Mac OSX (10.5.8) using Acrobat 7 Professional and Acrobat 
    Reader 9 to view the pdf. I created it by exporting. Attached is a 
    screen capture of the letterhead. Since I posted, I sent a test pdf to 
    my partner's computer eventhough it didn't look right on my system and 
    she said it looked fine to her. I've restarted my computer and tried 
    again and still get the same results.
    Thanks for your help,
    Pat Boullion
    Boullion Graphics
    281 444-5749
    Fax: 281 444-6507
    CONFIDENTIALITY NOTICE
    The information in this email may be confidential and/or privileged. 
    This email is intended to be reviewed by only the individual or 
    organization named above.
    If you are not the intended recipient or an authorized representative 
    of the intended recipient, you are hereby notified that any review, 
    dissemination or copying of this email and its attachments, if any, or 
    the information contained herein is prohibited. If you have received 
    this email in error, please immediately notify the sender by return 
    email and delete this email from your system.

  • I used to be able to refresh a page by hitting the F5 key. That does not seem to work anymore. Is there a keyboard shortcut for refresh, or can I create one?

    I used to be able to refresh a page by hitting the F5 key. With 4.0.1, that does not seem to work. Is there a different keyboard shortcut, or can I create one?

    Click the Refresh button on the right hand side of the location bar container on the Navigation Toolbar or press "Ctrl + R" or F5 to reload a web page.
    Reload web page(s) and bypass the cache.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)

  • I am trying to set up internet sharing from my macbook air but there does not seem to be an option for this because the air is connected to the internet via wifi connection. Is it possible to still share this?

    I am trying to set up internet sharing from my macbook air but there does not seem to be an option for this because the air is connected to the internet via wifi connection. Is it possible to still share this?

    It depends upon how the other machines are connecting to your MBA:
    If the the other machines are also using wi-fi, they can connect directly to the wireless access point (router) without going through your MBA
    If the other machines are connecting to the MBA using ethernet you can share your wi-fi connection to them

  • HT1923 I am using windows 7 and have upgraded itunes to 11. Now when I open my music library in itunes and click on a song it says "original file could not be found" Over 2000 songs come up this way and locate does not seem to work. Before the upgrade all

    With Windows 7 I upgraded itunes to 11. Now in my itunes library, when I click on a song "original file could not be found" comes up. This happens with over 2000 songs, but it seems to be ones I recorded from cd's. Locate does not seem to work. Has anyone else had this problem?

    Highlight a song that is supposedly missing, press CTRL+I to Get Info, say no when asked to locate the file, then look at the summary tab. Where does iTunes "think" the file should be? Where is it really? You may need to give a configuration file a minor tweak.
    tt2

  • My movie has clips that have some extracted audio that I would like to use for the menu music in iDVD 11. Does anyone know how to do this? Copy and paste does not seem to work.

    My iMovie 11 movie has clips that have some extracted audio that I would like to use for the menu music in iDVD 11. Does anyone know how to do this? Copy and paste does not seem to work.

    I would use Quicktime Pro.
    See: QuickTime Pro: How to Extract or Disable Tracks at http://docs.info.apple.com/article.html?artnum=42596 and QuickTime Player 7 Help - Extracting, Adding, and Moving Tracks at http://docs.info.apple.com/article.html?path=QuickTime%20Player/7/en/c3qt6.html
    To get Quicktime 7.6.6 for Snow Leopard see: QuickTime Player 7.6.6 for Mac OS X v10.6.3 at http://support.apple.com/kb/DL923  (Quicktime 7.6.6 is the latest version.)
    To upgrade to Quicktime Pro see: QuickTime Player 7 Help - Getting QuickTime Pro at http://docs.info.apple.com/article.html?path=QuickTime%20Player/7/en/c2qt.html

Maybe you are looking for

  • Notification issue:wf_notifications mail_status is null, status is CANCELED

    Hi All, In our HR systems, we use workflows extensively and in one of our custom workflows we send a notification to one group mail box. The FND_USER is defined and the group mail box address is given correctly. In the workflow we recursively send no

  • Developer Error: invalid  window block name passed to set_window_position

    Hi I had Registered a Form in Oracle apps After that i'm trying to open the form,then this message will be displayed Developer Error: invalid  window block name passed to set_window_position in the PreForm Trigger I had written the code as apps.set_w

  • AME encoding in black and white

    Currently trying out the After Effects CC trial and when trying to export a composition, AME is exporting in black and white only (H.264 -- Match Source - High bitrate preset on a Mac). I'm not seeing any obvious toggle for color changes. Is this a l

  • Using Shuffle to tranfer files

    Can I use my Shuffle to transfer music files from a Windows PC to a Mac. The reason is I want to get rid of my PC, the PC does not have iTunes and the files are kept in the My Music folder. Can this be done? I have read that I can and I have read tha

  • Multiple UDA properties in a Dimension -- Is it possible?

    I want to create two UDAs to define two propeerties in a dimension. Say, I have a customer dimension and I want to define two properties like 1) Customer Categories (Values may be anyone like Normal, Important, Very Important) and 2) Customer Territo