can someone help me how to get previous lines having the same provider

My question is:
I have a table

CREATE TABLE insert_table
(
NUMBER OF ACCTNUM,
DATE TIMESTAMP (3),
CODE VARCHAR2 (35 BYTE),
PROVIDER VARCHAR2 (35 BYTE)
)


I INSERTED SOME DATA IN IT:


1 1/22 / 2011 V1 BSO
1 1/23 / 2011 V1 BSOF
1 1/24 / 2011 BSOF V2
1 1/25 / 2011 V1 BSOF

IN THE SCENARIO ABOVE, I NEED TO GET RESULT AS:

1 1/22 / 2011 V1 BSO NO.
1 1/23 / 2011 V1 BSOF YES
1 1/24 / 2011 V2 BSOF NO.
1 1/25 / 2011 V1 BSOF YES

iAM the WAY GET THE RESULT in A COMPLEX:


SELECT ACCTnum, provider, date,
CASE
WHERE code = 'bsof.
THEN (CASE
WHEN COUNT(DISTINCT code) OVER (PARTITION BY ACCTnum, vendor) > 1 THEN
(CASE
WHEN LAG (code, 1, 0)
COURSES (PARTITION BY ACCTnum, provider
ORDER BY vendor, date) <>' 0'
THEN
(CASE
WHAT RANK)
COURSES (PARTITION BY ACCTnum, vendor ORDER BY 0) = 1
THEN '' Yes. ''
ON THE OTHER
'no' END)
ON THE OTHER
'no' END)
End ELSE ' no')
ON THE OTHER
'no' END
result
OF INSERT_TABLE
WHERE l_workcode IN ('iso', 'bsofu') and ACCTnum = 1
ORDER BY ACCTnum, date;

CAN SOMEONE HELP OUT ME IN A SIMPLE WAY


NOTE: FOR EACH ACCTNUM WE ONLY BSO FOR A PROVIDER AND SUPPLIERS HAVE CODE (BSOF).


PLEASE HELP ME URGENT

Your query can be rewritten as follows,

SELECT acctnum,l_date,
       CASE
         WHEN code = 'bsof'
          AND COUNT (DISTINCT code) OVER (PARTITION BY acctnum, vendor) > 1
          AND row_number () OVER (PARTITION BY acctnum, vendor ORDER BY vendor, l_date) != 1
         THEN 'yes'
       ELSE 'no' END result
  FROM TEMP_TABLE
WHERE code IN ('bso', 'bsof')  AND acctnum=1
ORDER BY acctnum ,l_date;

G.

Tags: Database

Similar Questions

  • users cannot save .pdf, .doc files using "Save target as" in google search results. Can someone help me, I couldn't have known that the same works very well on some computers.

    I am the Director of technical support for more than 1000 computers. Recently in some computers (windows based) users cannot save .pdf, .doc files using "Save target as" in google search results. Can someone help me, I couldn't have known that the same works very well on some computers.

    Hi MASPAdministrator,

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Windows XP forum.

    http://social.technet.Microsoft.com/forums/en-us/itproxpsp/threads

  • Can someone tell me how to get a div to the right of the current div? See the site

    I'm tryin so hard to make a CSS site all instead of using tables. Very difficult! Can someone look at http://www.duenorthdesign.com/pcm and tell me:

    (1) how to get a new div to straight line by current (light green) a. Currently he is underneath. I ' ve tried floating left we leave the new div move right. " Strange results! Tried to sail to the right... UGH. I've never felt so stupid in my life!

    (2) also, why my sleeve content outside of my div (light green article)? The div should not increase accordingly?

    Thank you very much, you're all so helpful!

    Expressing the height values explicit on containers is a bad idea because height limits how much the container can receive.   If necessary, use the min-height instead of the height property.

    3 boxes CSS - with margins and allegorical.

    http://ALT-Web.com/demos/3-CSS-boxes.shtml

    You can eliminate box #2.  Do not forget to give your float a width.  And don't forget to clear the floats when they became useless.

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • I used to have a box with the letters/folder called "All messages" - I do not have. Don't know what happened to her - I guess I could have deleted by accident? Can someone tell me how to get it back? Thank you

    I use the MAIL function on my MacBook Pro. I used to have a box with the letters/folder called "All messages" - I do not have. Don't know what happened to her - I guess I could have deleted by accident? Can someone tell me how to get it back? Thank you

    What do you mean 'all messages '? all mail entering, or email any or all all. ?

  • Hello I am downloading from my site and my characters are messy. I type an e (taken glyphs-window), but what appears is an and the copyright sign? can someone tell me how I get rid off this

    Hello I am downloading from my site and my characters are messy. I type an e (taken glyphs-window), but what appears is an and the copyright sign? can someone tell me how I get rid off this?

    I tried a lot of things, but nothing seems to make a difference.

    In my view, they have already done for you...

    The site seems OK now. Hooray !

    But let's dig down to the serious things of this.

    If the browser needs a statement of character. Probably ' UTF-8 ', but another or an older one would be as well, as long as it's cheap, and it respects the method of characterization of the Web page.

    This statement can be provided by (1) the web server itself (its default value), (2) the htaccess file in your web root directory server, or (3) on each web page. Where there are several and contradictory statements perhaps, the older in the command above rules. But in the case where the Server and the htaccess do not provide a statement of character and your web page later on, it shouldn't be a problem.

    Your provider said that they do not have a such context in their web server, and it wasn't a htaccess file in your root folder (Muse is not create it for you). Once again: do not worry, it should always be no problem, because all your web pages provides the declaration as well (thanks to Muse). We have checked that, no doubt.

    That is where their claim is not accurate. BTW: many tips are on the Internet on the common practice in this area and they all advice that the htaccess is not the place more obvious to the declaration. The page is the best place to put it.

    W3C (the 'boss' of http and html)

    some general information:

    Choosing & applying a character encoding

    putting in a .htaccess file:

    Definition of charset in .htaccess information

    and finally, put on the page:

    Declaring character encodings in HTML

    But what is even more strange: I checked the web server of your provider to access this service online, and it seems that their server is to provide a framework (and it is UTF-8, fortunately). It's the opposite of what they have been say...

    Now I have the idea of some personal provider noticed this morning that their server wasn't working properly (maybe after a failure of server or another incident or failure), serving the pages with a wrong setting. Then maybe they quickly corrected, and not to let you know that, they tell you to put in place this htaccess file (which makes no difference, just as the declaration of your page also could not prevail in the setting of the server).

    So now, you are done with all the three statements: a parameter, a htaccess in your Web site folder and that of your server page. As long as they all say and expect the same (UTF-8) you don't have to worry about this.

    Problem solved, three times!

    PS: many accommodation providers (and I'm afraid that yours as well) tend to declaring that whatever they do is 'standard' and 'obvious'. While in many situations, it's always a little different and certainly not the standard, not to mention obvious...

  • I lost the left sidebar of Indesign with all the tools.  Can someone tell me how to get it back?

    I lost the left sidebar of Indesign with all the tools of design.  Can someone tell me how to get it back?  I tried to quit smoking and the app and restarting, but the toolbar does not come to the top on the left side of the screen.

    Window > tools

  • Please can someone help me for a long time out of the payment itun

    Please can someone help me for a long time out of the payment of itun, I lost my phone.

    This is my information

    ****

    ****

    Thank you

    < personal information under the direction of the host >

    OK so tell me first your reason! It of your personal account, why do you give?

  • Can someone tell me how do you remove or change the name of a library on the opening?

    Can someone tell me how do you remove or change the name of a library on the opening?

    You remove an Aperture library by selecting it in the Finder and delete it like any other file.

    To rename an opening, library, use the Finder-click on the name of the library and enter a differnet name.  You can also select the library in the Finder, then enter the ⌘I key combination to open the information panel. Then change the name in the Info Panel.

  • Can someone tell me how I put a hiperlink in the new Adobe Muse CC 2014...

    Can someone tell me how I put a hiperlink in the new Adobe Muse CC 2014... ?

    See: http://helpx.adobe.com/muse/using/creating-hyperlinks.html

    See you soon,.

    Vikas

  • I continue to be prompted to install Silverlight when it is already installed. Can someone tell me how to get out of this loop of promting?

    I am a customer of netflix and watching movies/TV shows on my PC.  I watched a lot of movies in the past and today he says I have to install Silverlight.  So I thought 'Ok, maybe the version of Silverlight, I have glitched somehow. "  So I uninstalled and reinstalled and it's the same thing.  Can someone help me on how to convince my compy that he already Silverlight and didn't need another?

    Hey Becca444,

    Thanks for posting in the Microsoft answers site!

    You get asked to install Silverlight on a particular Web page or all of the sites you visit?

    Try to visit http://www.microsoft.com/Silverlight and see if Silverlight content on this page will load for you. Currently this site will show a carousel app that shows a few sites that use Silverlight. If you go over it and right click on your mouse, you should see "Silverlight" in the right click menu.

    If you see a prompt to install Silverlight on the site:

    · Is it installed? If you are using Windows, check the applet of Control Panel programs and see if Microsoft Silverlight is listed as installed.

    · If it is disabled? See the modules of your browser menu (for example, in Internet Explorer click on tools-> manage add-ons) and if you find Silverlight in there, and it is disabled, enable it and I hope that you will be ready to go.

    · Something else? You might want to try another browser to see if it's the specific browser. You can also try the forums of installation & installation on http://Silverlight.net.

    If Silverlight works very well on the site of Silverlight but not the site you are trying to visit, you will probably have to contact the author of the site. If you are the author of the site or you are just curious to know what can be wrong, here are some things I've seen causing the quick loop infinite installation.

    Check out the link for more details below:

    Silverlight Blog of Bob Pomeroy: Why should I get invited to install Silverlight on some Web sites?

    http://blogs.msdn.com/rpomeroy/archive/2009/06/17/why-do-i-keep-getting-prompted-to-install-Silverlight-on-some-websites.aspx

    If Silverlight doesn't work for you, and you get errors, try to uninstall, reinstall or upgrade Silverlight, it may be due to a broken Silverlight installation. Check the link for more details cleaning a machine to fix a broken below Silverlight installation:

     

    Silverlight Bob Pomeroy's Blog: How to manually clean a broken Silverlight installation

    http://blogs.msdn.com/rpomeroy/archive/2008/06/10/how-to-manually-clean-up-a-bad-Silverlight-installation.aspx

     

    Also, see the below link for a similar problem:

    Get invited to install Silverlight

    http://forums.Silverlight.NET/forums/p/121625/301084.aspx

     

    I hope this helps!

    Gokul T - Microsoft Support

  • My coprocesser needs a driver, it does not have a pilot. Can someone tell me how to get one?

    My coprocesser is not a driver; Can someone tell me how get/download a driver coprocesser?

    Hello:

    The driver that you need to (re) install that would install the coprocessor device would be the driver for chipset on the link below.

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-75757-1&cc=us&DLC=en&LC=en&OS=4062&product=3860051&sw_lang=

  • Hi can someone tell me how to get in touch with microsoft to check if my code is correct

    Hi all can someone tell me how I can contact microsoft to varify my coa is for the correct version of windows that the coa sticker worn if wrong that only the code itself is visible please help

    If the certificate of authenticity is attached to a computer, you must contact the manufacturer of this computer using.

  • BlackBerry Smartphones missing on my Storm lightning bolt theme. Can someone tell me how to get it?

    I bought my Storm the day of the release of my local Verizon. The theme, with what he came is a red screen with the check from Verizon. No offense to Verizon, but I don't want the theme. When I go into the themes, it shows a small picture of the correct theme but you can't choose it. I looked everywhere on the phone and can not find the scene of lightning. Funny thing is that I can't find a picture of the Verizon theme. So now the mystery thickens because from time to time when checking my email a brief overview of all the low 1/4 of the lightning theme appears. I had the Blackberry phone and they can't find a copy of the same e-mail me silly theme and no one can understand why my phone is like that. They claim, that he should have with the topic of lightning on him and not the theme of Verizon.

    Can someone help me with this? I'm not totally stupid techno, but I'm starting to feel like it.

    Thank you

    Sue G

    Here is a site that has some nice wallpapers. http://www.stormgrounds.com/

    and an another http://www.blackberrystormwallpaper.com/

    Also try this one http://crackberry.com/

  • Can someone help me, my video tag will be not the width of the browser to scale or answer, I tried width and 100% height?

    Hi, my problem is my video tag dimensionnera not the width of my browser, can someone help me. I use it as a background for my first page. His sat inside a container. Here's the code.

    I tried etc. 100% width and height nothing seems to be letting me do this video the browser all the scale and be reactive. Can someone help me?

    < div id = "fullpage" >

    <! - Here are the sections of the page - >

    < div class = "section" id = "section0" >

    < div class = "container" >

    < div id = "video-container" >

    < video id = "BackgroundSection1" class = "Container1" preload = 'auto' autoplay muted loop >

    < src = "source file.mp4' type =" video/mp4">"

    <! - Videobackground - >

    does not support.

    < / source >

    < / video >

    < / div > <!--end of video container-->

    I think that I misread your question the 1st time.

    Maybe that's what you really want:

    Background of the Page video fullscreen HTML5

    Nancy O.

  • How to extend a line on the same angle?

    I am trying to extend this line along the same angle using the tool by selecting the end anchor and opening the dialog box move.

    I offer 10 cm from the same angle, looking at a clip, endpoint does not seem to be on the same angle that my initial line, what am I, I did wrong here?

    original line

    lineextend1.png

    adjustment in preview.

    lineextend2.png

    in fact I have get it now...

    If I place the anchor in the middle of origin (0,0)

    the zero angle is horizontal going right. Here, a shift of 5 cm along the horizontal position.

    at 90 degrees, it is a vertical climb of origin (0,0) of the distance 5 cm or - 5 cm vertically according to the 2D space mapping illustrators.

    and so on, 180 degrees, moves the point of anchor-5 cm horizontally as 180 is the opposite of the direction of 0 degrees

    and finally, rotate another 90 degrees (180 + 90 = 270) + 42 degrees = 312 degrees it will go through the same angle/vector as my original line (No 315 degrees because my original point was not precisely placed on the origin.)

    Original point zoom not accurately on the origin...

Maybe you are looking for