Help with LAG

I just wanted to know with the help of LAG function in Oracle, is it possible to get some previous rows instead of immediate previous..
For eg.,
if a table has values as follows:
Col1    Col2
1         2
2         3
3         5
4         8
5         9
6         10Using LAG function is it possible to get the rows as follows:
Col1    Col2         3_Prev_Values
1         2            0
2         3            0
3         5            2
4         8            3
5         9            5
6         10          8Here the values in the third column are values which are 3 rows behind..
Any help???

LAG has an offset parameter which you can set to 3.
See more at the oracle help page here
http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions56a.htm

Similar Messages

  • Help with lag in program

    This is my first time posting and I am new to LabVIEW. I took the NI Basic and Intermediate courses and now I am the "expert" at work. When I run my program, the plots are fine but when I start writing to a file there is a lot of lag on the plots. I do not know what the 'actual' problem is and what I should do to fix it.
    I created a program to read 12 Analog Voltage inputs and plot them and also write to file.
    I am using LabVIEW 11, 32-bit on Windows XP
    DAQ Hardware:  0-10Volt signals from pressure transducers   ->  NI 9205  ->  NIcDAQ-9174 
    Thanks,
    Chris
    Attachments:
    WaveTest_1.5.vi ‏243 KB

    Vastly superior! Here's your first Kudos for the effort!
    Let my make a couple suggestions and then I'll try to answer your questions.
    you have almost no code in case 0 its just there to init FP values you may be better served to remove the stacked sequence and replace all code in case0 with a invoke node and run the method "Default Values:Reintialize All To Default" (Select Class. VI Server>VI>VI)  if you leave the referance input unwired the invoke node assumes "This VI" and should operate as desired.
    Implementing the above- the event loop is allways ready to service events- If you do not chose to remove the sequence structure consider moving the event loop outside the sequence structure.
    There is no reason to enqueue default data (might even be bad) push the enqueue inside the case with the DAQ assistant
    2) Writing to a terminal, local or value property node does not cause a value change event.  VCEs are only generated by user interaction that changes a value or writing to a value(signaling) property node NOTE:  Value(Signaling) Allways fires the VC event even if you write the existing value (These points burn developers every day- we almost all have learned them the hard way)
    1)This will have to be done by splitting and merging the signals into "channel groups" that can be built into an array
    Jeff

  • Help with LAG () OVER () and dates

    I have the following query right now
      SELECT "DATE",
              "CELL_SITE",
              "LASTV_ATTCNT",
              "LASTV_ATTCNT2",
              "LASTV_BLKCNT",
              "LASTV_DRPCNT",
              "V_ATT_CNT",
              "V_CUST_BLK_CNT",
              "V_DRP_CALL_CNT",
              "LASTD_ATTCNT",
              "LASTD_BLKCNT",
              "LASTD_DRPCNT",
              "D_ATT_CNT",
              "D_CUST_BLK_CNT",
              "D_DRP_CALL_CNT"         
         FROM (  SELECT DATE,
                       CELL_SITE,
                        LAG (SUM (V_ATT_CNT), 24)
                           OVER (PARTITION BY BSM_NM ORDER BY DATE)
                           AS "LASTV_ATTCNT",
                        LAG (SUM (V_CUST_BLK_CNT), 24)
                           OVER (PARTITION BY BSM_NM ORDER BY DATE)
                           AS "LASTV_BLKCNT",
                        LAG (SUM (V_DRP_CALL_CNT), 24)
                           OVER (PARTITION BY BSM_NM ORDER BY DATE)
                           AS "LASTV_DRPCNT",
                        LAG (SUM (D_ATT_CNT), 24)
                           OVER (PARTITION BY BSM_NM ORDER BY DATE)
                           AS "LASTD_ATTCNT",
                        LAG (SUM (D_CUST_BLK_CNT), 24)
                           OVER (PARTITION BY BSM_NM ORDER BY DATE)
                           AS "LASTD_BLKCNT",
                        LAG (SUM (D_DRP_CALL_CNT), 24)
                           OVER (PARTITION BY BSM_NM ORDER BY DATE)
                           AS "LASTD_DRPCNT",
                        SUM (V_ATT_CNT) AS "V_ATT_CNT",
                        SUM (V_CUST_BLK_CNT) AS "V_CUST_BLK_CNT",
                        SUM (V_DRP_CALL_CNT) AS "V_DRP_CALL_CNT",
                        SUM (D_ATT_CNT) AS "D_ATT_CNT",
                        SUM (D_CUST_BLK_CNT) AS "D_CUST_BLK_CNT",
                        SUM (D_DRP_CALL_CNT) AS "D_DRP_CALL_CNT"
                   FROM DMSN.DS3R_FH_1XRTT_FA_LVL_KPI
                  WHERE DATE >
                             (SELECT MAX (DATE) FROM DMSN.DS3R_FH_1XRTT_FA_LVL_KPI)
                           - 2
               GROUP BY DATE, CELL_SITE)
        WHERE DATE >=
                 (SELECT MAX (DATE) - NUMTODSINTERVAL (12, 'HOUR')
                    FROM DMSN.DS3R_FH_1XRTT_FA_LVL_KPI)What I've noticed is that the LAG function is doing kind of what I want but not exactly. Lets say I have data for hours 12AM, 1AM, 2AM, 3AM, 4AM, 5AM, 6AM, 7AM, 8AM, 9AM, 10AM, 11AM, 12PM, and that the current hour is 12PM, the LAG function goes back to 12AM, which is what it should be doing.
    but lets say I have data for 12AM, 1AM, 2AM, 3AM, 4AM, 5AM, 7AM, 8AM, 9AM, 10AM, 11AM, 12PM, but am MISSING 6AM (no data for 6AM). The lag function will now go back to 11PM instead of 12AM since the 6AM hour is missing.
    if I have data for 12AM, 1AM, 2AM, 3AM, 4AM, 7AM, 8AM, 9AM, 10AM, 11AM, 12PM and am MISSING 5AM and 6AM, the data will go back to 10PM then and not just 12AM.
    Can I prevent this from happening and always just go back 12 hours?
    Edited by: k1ng87 on Apr 25, 2013 1:27 PM

    Hi,
    k1ng87 wrote:
    LAG (SUM (V_ATT_CNT), 24)
    OVER (PARTITION BY BSM_NM ORDER BY DATE)
    AS "LASTV_ATTCNT",
    LAG (SUM (V_CUST_BLK_CNT), 24)
    OVER (PARTITION BY BSM_NM ORDER BY DATE)
    AS "LASTV_BLKCNT",
    LAG (SUM (V_DRP_CALL_CNT), 24)
    OVER (PARTITION BY BSM_NM ORDER BY DATE)
    AS "LASTV_DRPCNT",
    Since you want so many columns from the same previous row, it would probably be simpler and more efficient to do a self-join, rather than so many LAG functions.
    What I've noticed is that the LAG function is doing kind of what I want but not exactly. Lets say I have data for hours 12AM, 1AM, 2AM, 3AM, 4AM, 5AM, 6AM, 7AM, 8AM, 9AM, 10AM, 11AM, 12PM, and that the current hour is 12PM, the LAG function goes back to 12AM, which is what it should be doing.You're always passing 24 as the 2nd argument to LAG; that means "Return the value from the 24th precding row." If there's a row for every hour, and the current row is 12PM, then wouldn't 24 rows back would be 12PM yesterday, not 12AM? Maybe you meant to pass 12, not 24, as the second argument to LAG. I'll assume you really want the 24th row rom now on, but the technique is the same whether that number is 24 or 12.
    but lets say I have data for 12AM, 1AM, 2AM, 3AM, 4AM, 5AM, 7AM, 8AM, 9AM, 10AM, 11AM, 12PM, but am MISSING 6AM (no data for 6AM). The lag function will now go back to 11PM instead of 12AM since the 6AM hour is missing.
    if I have data for 12AM, 1AM, 2AM, 3AM, 4AM, 7AM, 8AM, 9AM, 10AM, 11AM, 12PM and am MISSING 5AM and 6AM, the data will go back to 10PM then and not just 12AM.
    Can I prevent this from happening and always just go back 12 hours?A self-join would handle this automatically: it will look for the matching row, without regard for which other rows might be present or absent.
    If you really had to do this with analytic functions, you could use MIN or FIRST_VALUE with a range window:
    RANGE BETWEEN  1 + (.5 / 24)  PRECEDING
          AND      1 - (.5 / 24)  PRECEDINGWhen you ORDER BY a DATE column (don't call it "DATE"), the units are 1 day, so 1+(.5/24) days ago is 24.5 hours ago; that is, the window only includes DATES between 24.5 and 23.5 hours ago.
    If, for some reason, you really wanted to call LAG, then you could do an outer join to guarantee that a row was present for each of the preceding 24 hours.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Help with encapsulation and a specific case of design

    Hello all. I have been playing with Java (my first real language and first OOP language) for a couple months now. Right now I am trying to write my first real application, but I want to design it right and I am smashing my head against the wall with my data structure, specifically with encapsulation.
    I go into detail about my app below, but it gets long so for those who don't want to read that far, let me just put these two questions up front:
    1) How do principles of encapsulation change when members are complex objects rather than primitives? If the member objects themselves have only primitive members and show good encapsulation, does it make sense to pass a reference to them? Or does good encapsulation demand that I deep-clone all the way to the bottom of my data structure and pass only cloned objects through my top level accessors? Does the analysis change when the structure gets three or four levels deep? Don't DOM structures built of walkable nodes violate basic principles of encapsulation?
    2) "Encapsulation" is sometimes used to mean no public members, othertimes to mean no public members AND no setter methods. The reasons for the first are obvious, but why go to the extreme of the latter? More importantly HOW do you go to the extreme of the latter? Would an "updatePrices" method that updates encapsulated member prices based on calculations, taking a single argument of say the time of year be considered a "setter" method that violates the stricter vision of encapsulation?
    Even help with just those two questions would be great. For the masochistic, on to my app... The present code is at
    http://www.immortalcoil.org/drake/Code.zip
    The most basic form of the application is statistics driven flash card software for Japanese Kanji (Chinese characters). For those who do not know, these are ideographic characters that represent concepts rather than sounds. There are a few thousand. In abstract terms, my data structure needs to represent the following.
    -  There are a bunch of kanji.
       Each kanji is defined by:
       -  a single character (the kanji itself); and
       -  multiple readings which fall into two categories of "on" and "kun".
          Each reading is defined by:
          -  A string of hiragana or katakana (Japanese phoenetic characters); and
          -  Statistics that I keep to represent knowledge of that reading/kanji pair.Ideally the structure should be extensible. Later I might want to add statistics associated with the character itself rather than individual readings, for example. Right now I am thinking of building a data structure like so:
    -  A Vector that holds:
       -  custom KanjiEntry objects that each hold
          -  a kanji in a primitive char value; and
          -  two (on, kun) arrays or Vectors of custom Reading objects that hold
             -  the reading in a String; and
             -  statistics of some sort, probably in primitive valuesFirst of all, is this approach sensible in the rough outlines?
    Now, I need to be able to do the obvious things... save to and load from file, generate tables and views, and edit values. The quesiton of editting values raises the questions I identified above as (1) and (2). Say I want to pull up a reading, quiz the user on it, and update its statistics based on whether the user got it right or wrong. I could do all this through the KanjiEntry object with a setter method that takes a zillion arguments like:
    theKanjiEntry.setStatistic(
    "on",   // which set of readings
    2,      // which element in that array or Vector
    "score", // which statistic
    98);      // the valueOr I could pass a clone of the Reading object out, work with that, then tell the KanjiEntry to replace the original with my modified clone.
    My instincts balk at the first approach, and a little at the second. Doesn't it make more sense to work with a reference to the Reading object? Or is that bad encapsulation?
    A second point. When running flash cards, I do not care about the subtlties of the structure, like whether a reading is an on or a kun (although this is important when browsing a table representing the entire structure). All I really care about is kanij/reading pairings. And I should be able to quickly poll the Reading objects to see which ones need quizzing the most, based on their statistics. I was thinking of making a nice neat Hashtable with the keys being the kanji characters in Strings (not the KanjiEntry objects) and the values being the Reading objects. The result would be two indeces to the Reading objects... the basic structure and my ad hoc hashtable for runninq quizzes. Then I would just make sure that they stay in sync in terms of the higher level structure (like if a whole new KanjiEntry got added). Is this bad form, or even downright dangerous?
    Apart from good form, the other consideration bouncing around in my head is that if I get all crazy with deep cloning and filling the bottom level guys with instance methods then this puppy is going to get bloated or lag when there are several thousand kanji in memory at once.
    Any help would be appreciated.
    Drake

    Usually by better design. Move methods that use the
    getters inside the class that actually has the data....
    As a basic rule of thumb:
    The one who has the data is the one using it. If
    another class needs that data, wonder what for and
    consider moving that operation away from that class.
    Or move from pull to push: instead of A getting
    something from B, have B give it to A as a method
    call argument.Thanks for the response. I think I see what you are saying.. in my case it is something like this.
    Solution 1 (disfavored):
    public class kanjiDrill{ // a chunk of Swing GUI or something
         public void runDrill(Vector kanjiEntries){
              KanjiEntry currentKanjiEntry = kanjiEntries.elementAt(0); // except really I will pick one randomly
              char theKanji = currentKanjiEntry.getKanji();
              String theReading = currentKanjiEntry.getReading();
              // build and show a flashcard based on theKanji and theReading
              // use a setter to change currentKanji's data based on whether the user answers correctly;
    }Solution 2 (favored):
    public class kanjiDrill{ // a chunk of Swing GUI or something
         public void runDrill(Vector kanjiEntries){
              KanjiEntry currentKanjiEntry = kanjiEntries.elementAt(0); // except really I will pick one randomly
              currentKanji.buildAndShowFlashcard(); // method includes updating stats
    }I can definitely see the advantages to this, but two potential reasons to think hard about it occur to me right away. First, if this process is carried out to a sufficient extreme the objects that hold my data end up sucking in all the functionality of my program and my objects stop resembling natural concepts.
    In your shopping example, say you want to generate price tags for the items. The price tags can be generated with ONLY the raw price, because we do not want the VAT on them. They are simple GIF graphics that have the price printed on a an irregular polygon. Should all that graphics generating code really go into the item objects, or should we just get the price out of the object with a simple getter method and then make the tags?
    My second concern is that the more instance methods I put into my bottom level data objects the bigger they get, and I intend to have thousands of these things in memory. Is there a balance to strike at some point?
    It's not really a setter. Outsiders are not setting
    the items price - it's rather updating its own price
    given an argument. This is exactly how it should be,
    see my above point. A breach of encapsulation would
    be: another object gets the item price, re-calculates
    it using a date it knows, and sets the price again.
    You can see yourself that pushing the date into the
    item's method is much beter than breaching
    encapsulation and getting and setting the price.So the point is not "don't allow access to the members" (which after all you are still doing, albeit less directly) so much as "make sure that any functionality implicated in working with the members is handled within the object," right? Take your shopping example. Say we live in a country where there is no VAT and the app will never be used internationally. Then we would resort to a simple setter/getter scheme, right? Or is the answer that if the object really is pure data are almost so, then it should be turned into a standard java.util collection instead of a custom class?
    Thanks for the help.
    Drake

  • Help with Reconnecting Files

    Over this past weekend I was moving, via Relocate Masters, large numbers of images from managed status on my MacBook Pro to referenced status on an external drive (an Air Disk, to be precise). This had gone fine for thousands of images, but Sunday night I returned to the computer to find that it was completely locked up in mid-Relocate, and seemed to have been locked up for a while. I'm not sure what happened, but it seemed bad -- I couldn't get to the Force Quit dialog, or anywhere else. I powered down by holding in the power button.
    Upon resurrecting things, Aperture would not open the library. Long story shorter, I rebuilt the database and was then able to see the library contents again. But then I noticed that many files were "offline." Digging further, and using the Manage Referenced Files box, I discovered that some 3500 files need to be reconnected.
    The Reconnect All button did a little bit of magic for me, but now I've gotten to a point where using Reconnect All only reconnects one file at a time. I was renaming files as I Relocated Masters, and my fear is that this is what has caused the disconnect. *So first,* can anyone tell me that this is what has caused the problem (the problem being my apparent need to now reconnect 3400 files, one-by-one)?
    *Second, and more importantly to me, do I have any recourse beyond reconnecting one-by-one?* Again, the problem seems to me to be that the library file expects a file named image.jpg (or whatever), because the change of the file name to greatimage.jpg that occurred during Relocation did not get written to the library file.
    Many thanks for all help and suggestions.

    Homme dArs wrote:
    I hope someone else can join in with a definitive answer to your problem, but I don't believe you will be happy using the configuration you are attempting to set up.
    Having Aperture access your images via wireless is going to be very very slow, and any connection problems will be very frustrating. I have even abandoned the idea of using wireless backup of image files because it so slow.
    Perhaps someone can help with your immediate problem, but I would strongly suggest you find a way to store your referenced files locally (a firewire drive would be ideal).
    Thanks. I certainly appreciate your thought, and before trying it myself, my instinct was the same as yours. That said, until the present problem cropped up, I have to say it has been quite a good solution. My network is 802.11n, and I've noticed no real lag in accessing the files or otherwise using Aperture with a library stored as this is.
    But yes, I hope someone is able to help me get these 3400-some files reconnected short of one-by-one.
    Thank you for your comments.

  • Need Help with Address Display

    I need help with APEX.
    Here's my situation:
    I have a report that displays brief employee information. Among the information displayed is the Address. Right now, it's display as:
    Mr X
    Employee Id
    Accounting Department
    Address 1
    Mr X
    Employee Id
    Accounting Department
    Address 2
    I would like it to display
    Mr X
    Employee Id
    Accounting Department
    Address 1
    Address 2
    1) I have thought of using the Break functionality; however, the function only allows break at column 1, 2, 3. As you can see Address starts at column 4. Also, Address has a few columns; Address Line 1, Address Line 2, City, State, Zipcode.
    2) Stragg functions - I'm not sure how to implement it since it has more than 1 columns.
    Any ideas?
    Thanks in advance
    Andrew

    The example I gave you, using analytic functions is a simple one.
    Now, you are saying:
    1. some of the employees may have two adresses?
    2. if this is the case, your employee appears in the report twice?
    3. you don't want his name, employee id and accounting department to appear twice?
    4. only his address has to be displayed?
    If the answer to all the questions is yes, this kind of query will help you. I repeat:
    SELECT CASE
              WHEN LAG (employee_id) OVER (ORDER BY employee_id) =
                                                        employee_id
                 THEN NULL
              ELSE employee_name
           END employee_name,
           CASE
              WHEN LAG (employee_id) OVER (ORDER BY employee_id) =
                                                          employee_id
                 THEN NULL
              ELSE employee_id
           END employee_id,
           CASE
              WHEN LAG (employee_id) OVER (ORDER BY employee_id) =
                                                employee_id
                 THEN NULL
              ELSE accounting_department
           END accounting_department,
           street, postal_code, city, state, country
      FROM your_employees_table;Give it a try.
    Denes Kubicek

  • Help with queries about boot camp and partition, please.

    Hi, I am hoping to partition my HDD. I have done this before, when I first got my macbook but got rid of it, and now I can't fully remember the do's and don'ts' of boot camp. I just need a few questions answered before I take any action.
    1. I have a 120GB HDD with about 15GB free space. If I partition the drive will I lose any data on my existing HDD?
    2. What is the minimal amount of space I can partition the drive and install Windows?
    (I have a copy of Windows XP SP2, and really only need to install it for the use of one program that isn't available on the Apple operating systems.)
    3. I tried using Parallels in which Windows took up about 6GB, will it be about the same again? I uninstalled it because I found it to lag a bit.
    If you can help with any of these queries I would really appreciate it, thanks!

    Maybe you should first get a larger drive; you don't have much more than the minimum 10% free space that Mac OS needs.
    Retry with Sun's VirtualBox. Maybe you just need more memory.
    Lose data? Step #1: backup.
    You may need to backup and erase your hard drive and then restore.
    I'd invest in 300GB drive though.

  • Anybody can help with this SQL?

    The table is simple, only 2 columns:
    create table personpay(
    id integer primary key,
    pay number(8,2) not null);
    So the original talbe looks like this:
    ID PAY
    1 800
    2 400
    3 1200
    4 500
    5 600
    6 1900
    The requirement is to use one single query(no pl/sql) to show something lile the following, in other words, for each ID, the pay is the sum of all before itself and itself. So the query result looks like this:
    ID PAY
    1 800
    2 1200
    3 2400
    4 2900
    5 3500
    6 5400
    Again, just use one sql. No pl/sql. Anybody can help with this? I really appreciate that.
    thanks,

    Eh, people are so "analytically minded" that can't even notice a simple join?
    Counting Ordered Rows
    Let’s start with a basic counting problem. Suppose we are given a list of integers, for example:
    x
    2
    3
    4
    6
    9
    and want to enumerate all of them sequentially like this:
    x      #
    2      1
    3      2
    4      3
    6      4
    9      5
    Enumerating rows in the increasing order is the same as counting how many rows precede a given row.
    SQL enjoys success unparalleled by any rival query language. Not the last reason for such popularity might be credited to its proximity to English . Let examine the informal idea
    Enumerating rows in increasing order is counting how many rows precede a given row.
    carefully. Perhaps the most important is that we referred to the rows in the source table twice: first, to a given row, second, to a preceding row. Therefore, we need to join our number list with itself (fig 1.1).
    Cartesian Product
    Surprisingly, not many basic SQL tutorials, which are so abundant on the web today, mention Cartesian product. Cartesian product is a join operator with no join condition
    select A.*, B.* from A, B
    Figure 1.1: Cartesian product of the set A = {2,3,4,6,9} by itself. Counting all the elements x that are no greater than y produces the sequence number of y in the set A.
    Carrying over this idea into formal SQL query is straightforward. As it is our first query in this book, let’s do it step by step. The Cartesian product itself is
    select t.x x, tt.x y
    from T t, T tt
    Next, the triangle area below the main diagonal is
    select t.x x, tt.x y
    from T t, T tt
    where tt.x <= t.x
    Finally, we need only one column – t.x – which we group the previous result by and count
    select t.x, count(*) seqNum
    from T t, T tt
    where tt.x <= t.x
    group by t.x
    What if we modify the problem slightly and ask for a list of pairs where each number is coupled with its predecessor?
    x      predecessor
    2      
    3      2
    4      3
    6      4
    9      6
    Let me provide a typical mathematician’s answer, first -- it is remarkable in a certain way. Given that we already know how to number list elements successively, it might be tempted to reduce the current problem to the previous one:
    Enumerate all the numbers in the increasing order and match each sequence number seq# with predecessor seq#-1. Next!
    This attitude is, undoubtedly, the most economical way of thinking, although not necessarily producing the most efficient SQL. Therefore, let’s revisit our original approach, as illustrated on fig 1.2.
    Figure 1.2: Cartesian product of the set A = {2,3,4,6,9} by itself. The predecessor of y is the maximal number in a set of x that are less than y. There is no predecessor for y = 2.
    This translates into the following SQL query
    select t.x, max(tt.x) predecessor
    from T t, T tt
    where tt.x < t.x
    group by t.x
    Both solutions are expressed in standard SQL leveraging join and grouping with aggregation. Alternatively, instead of joining and grouping why don’t we calculate the count or max just in place as a correlated scalar subquery:
    select t.x,
    (select count(*) from T tt where tt.x <= t.x) seq#
    from T t
    group by t.x
    The subquery always returns a single value; this is why it is called scalar. The tt.x <= t.x predicate connects it to the outer query; this is why it is called correlated. Arguably, leveraging correlated scalar subqueries is one the most intuitive techniques to write SQL queries.
    How about counting rows that are not necessarily distinct? This is where our method breaks. It is challenging to distinguish duplicate rows by purely logical means, so that various less “pure” counting methods were devised. They all, however, require extending the SQL syntactically, which was the beginning of slipping along the ever increasing language complexity slope.
    Here is how analytic SQL extension counts rows
    select x, rank() over(order by x) seq# from T; -- first problem
    select x, lag() over(order by x) seq# from T; -- second problem
    Many people suggest that it’s not only more efficient, but more intuitive. The idea that “analytics rocks” can be challenged in many ways. The syntactic clarity has its cost: SQL programmer has to remember (or, at least, lookup) the list of analytic functions. The performance argument is not evident, since non-analytical queries are simpler construction from optimizer perspective. A shorter list of physical execution operators implies fewer query transformation rules, and less dramatic combinatorial explosion of the optimizer search space.
    It might even be argued that the syntax could be better. The partition by and order by clauses have similar functionality to the group by and order by clauses in the main query block. Yet one name was reused, and the other had been chosen to have a new name. Unlike other scalar expressions, which can be placed anywhere in SQL query where scalar values are accepted, the analytics clause lives in the scope of the select clause only. I have never been able to suppress an impression that analytic extension could be designed in more natural way.

  • Firefox 23.0.1 lags. YouTube plays with lag. Only happens with Firefox browser. Any solution? Ability to download from YouTube only reason keeping FFox.

    Videos from the internet play with lag. Pages scroll with lag. Pointer lags only on browser. There are no pending downloads in my computer. Saw a similar problem but it is not applicable to this issue. I have deleted cookies and other stuff and the problem persists. Already using Chrome but Fire Fox ability to download YouTube videos is only reason I still keep it. Loyal to Fire Fox for many years but this is becoming a mayor issue.

    In order to be able to find the correct solution to your problem, we require some more non-personal information from you. Please do the following:
    *Click the Firefox button at the top left, then click the ''Help'' menu and select ''Troubleshooting Information'' from the submenu. If you don't have a Firefox button, click the Help menu at the top and select ''Troubleshooting Information'' from the menu.
    Now, a new tab containing your troubleshooting information should open.
    *At the top of the page, you should see a button that says "Copy text to clipboard". Click it.
    *Now, go back to your forum post and click inside the reply box. Press Ctrl+V to paste all the information you copied into the forum post.
    If you need further information about the Troubleshooting information page, please read the article [[Use the Troubleshooting Information page to help fix Firefox issues]].
    Thanks in advance for your help!

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • I need help with Sunbird Calendar, how can I transfer it from one computer to the other and to my iphone?

    I installed Sunbird in one computer and my calendar has all my infos, events, and task that i would like to see on another computer that i just downloaded Sunbird into. Also, is it possible I can access Sunbird on my iphone?
    Thank you in advance,

    Try the forum here - http://forums.mozillazine.org/viewforum.php?f=46 - for help with Sunbird, this forum is for Firefox support.

  • Hoping for some help with a very frustrating issue!   I have been syncing my iPhone 5s and Outlook 2007 calendar and contacts with iCloud on my PC running Vista. All was well until the events I entered on the phone were showing up in Outlook, but not

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

  • Help with HP Laser Printer 1200se

    HP Support Line,
    Really need your assistance.  I have tried both contacting HP by phone (told they no longer support our printer via phone help), the tech told me that I needed to contact HP by e-mail for assistance.   I then sent an e-mail for assistance and got that reply today, the reply is as follows  "Randall, unfortunately, HP does not offer support via e-mail for your product.  However many resources are available on the HP web site that may provide the answer to your inquiry.  Support is also available via telephone.  A list of technical support numbers can be round at the following URL........."  The phone numbers listed are the ones I called and the ones that told me I needed to contact the e-mail support for help.
    So here I am looking for your help with my issue.
    We just bought a new HP Pavillion Slimline Desk Top PC (as our 6 year old HP Pavillion PC died on us).  We have 2 HP printers, one (an all-in-one type printer, used maily for copying and printing color, when needed) is connected and it is working fine with the exception of the scanning option (not supported by Windows 7).  However we use our Laser Printer for all of our regular prining needs.  This is the HP LaserPrinter 1200se, which is about 6 years old but works really well.  For this printer we currently only have a parallel connection type cord and there is not a parallel port on the Slimline HP PC.  The printer also has the option to connedt a USB cable (we do not currently have this type of cable).
    We posed the following two questions:
    1.  Is the Laser Jet 1200se compatible with Windows 7?
    and if this is the case
    2.  Can we purchase either a) a USC connection cord (generic or do we need a printer specific cord)? or b) is there there a printer cable converter adapater to attach to our parallel cable to convert to a USB connection?
    We do not want to purchase the USB cable if Windows 7 will not accept the connection, or if doing this will harm the PC.
    We really would appreciate any assitance that you might give us.
    Thank you,
    Randy and Leslie Gibson

    Sorry, both cannot be enabled by design.  That said, devices on a network do not care how others are connected.  You can print from a wireless connection to a wired (Ethernet) printer and v/v.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Going to Australia and need help with Power converters

    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  

    godzillafan868 wrote:
    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  
    Check the specs on input voltage/frequency of your power supplies.
    Many laptop power supplies are "universal/global" and are specced something like 80-265 volts AC 50/60 Hz, but not all.  These will just need a connector adapter.
    Unsure about the PS3 Slim - if it isn't universal it could be difficult as you'll need a 110/220 transformer, one big enough (power-handling wise) for the PS3 will be very bulky.
    For the external WD HDD, if it doesn't have a universal supply, you're probably best off just finding a new wallwart for it that is capable of running on 220/50.
    *disclaimer* I am not now, nor have I ever been, an employee of Best Buy, Geek Squad, nor of any of their affiliate, parent, or subsidiary companies.

  • Creation of context sensitive help with pure FM 12 usage doesn't work

    Hi,
    I hope somebody is able to help me with a good hint or tip.
    I am trying to create a context-sensitive Microsoft Help with FM12 only using the abilities of FM (no RoboHelp). For some reasons, my assigned ID's are not used in the generated chm file and therefore the help does not work context-sensitively.
    What did I do?
    - I created my FM files and assigned topic aliases to the headers. I did this two ways: a) using the "Special" menue and assigning a CSH marker and/or b) setting a new marker of type "Topic Alias" and typing the ID. I used only numeric IDs like "2000" or "4200",
    - I created a .h file (projectname.h) - based on the format of the file projectname_!Generated!.h (I read this in some instructions). So the .h file (text file) looks like this:
    #define 2000 2000 /* 4 Anwendungsoberfläche */
    #define 2022 2022 /* 4.1.1 Menü Datei */
    #define 2030 2030 /* 4.1.3 Menü Parametersatz */
    #define 2180 2180 /* 6.6.7 Objektdialog Q-Regler */
    #define 2354 2354 /* 6.9.2 Objektdialog Extran Parameter */
    #define 2560 2560 /* 6.9.5 Objektdialog Extran2D Parametersatz */
    - I published the Microsoft HTML Help. A projectname_!Generated!.h has been created. My IDs were not used in this file:
    #define 2000    1
    #define 2022    2
    #define 2030    3
    #define 2180    4
    #define 2354    5
    #define 2560    6
    - When I open the .chm file and look in the source code, the ID even is totally different. It is not the one, I assigned in FM, it is not the one which I assigned in the projectname.h file and it even is not the one, which was put in the projectname_!Generated!.h file. It is a generated name starting with CSH_1 ...n in a consecutive way numbered.
    Example:
    <p class="FM_Heading1"><a name="XREF_72066_13_Glossar"></a>Gloss<a name="CSH_1"></a>ar</p>
    What goes wrong? Why does FM not take my assigned IDs? I need to use these IDs since our programmers are using those already - I had to re-create the whole online help but the programs stay untouched.
    Please help!
    Many thanks
    Mohi

    Hi Jeff,
    thanks for your note!
    The text in my marker is just a number like "2000" or "4200". As said, I created manually a my.h file and used this marker there. E.g.
    #define 2000 2000.
    Whereby the first 2000 (in my opinion) is the marker text and the second 2000 is the context ID which the programmers are using for the context sensitive call of the help. My definitions in the my.h file were translated to #define 2000 1 (in the my_!Generated!.h file). The source code "translates" the context ID into CSH_8.
    I am still confused :-/
    Thanks
    Mohi

Maybe you are looking for

  • Button on page opens new window, session times out in old window

    Hi, I've created a custom page and added a button through personalizations in Oracle that opens the new custom page in a new window. When this happens, though, the original window throws the following error when a user attempts to use any functionali

  • Sync Mail and iCal iPad with MacBook?

    I have a 2 year old MacBook (sys 10.6.8) and am considering buying a new iPad Mini. I shall want to sync iCal and Mail. Can I do this please? I don't want to sync iTunes. Also, if my MacBook is connected to my printer, will I be able to print using w

  • Select sysdate from dual (to custom format).

    Dear all, i like to SELECT SYSDATE FROM DUAL, and run this result in a query something like: SELECT X, Y, Z FROM TABLENAME WHERE ACCESSDATE = (SELECT SYSDATE FROM DUAL); The problem is that the value of ACCESSDATE is in an format like DD-MM-YYYY and

  • Logging Not Working?

    For some reason i cant get the logging to work on weblogic, although it was working the other day. Im going mad with this problem as the code is some simple. In an EJB i basically do this... serverLogger = LoggingHelper.getServerLogger(); serverLogge

  • Date format mask failure stops navigation

    I'm trying to allow users to enter dates in multiple formats. My date items already have format mask 'YYYY-MM-DD'. I have added ON-ERROR code that handles errors like FRM-50003 so that users can enter '29-APR-2011' and the error handler fills the dat