How to achieve this?

Hi Friends,
I'm facing one strange problem. Not able to figure it out how to get it. Basically, not able to identify a particular window to let oracle understand how to behave.
Let's find the problem ->
Oracle Version ->
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE     11.2.0.1.0     Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> And, input data ->
with tt
as
      select 'SAP_ALL' sap_type,'' sap_det_type,1 s_no from dual union all
      select '','Dialog',2 from dual union all
      select '','Service',3 from dual union all
      select '','System',4 from dual union all
      select '','Communication',5 from dual union all
      select '','Reference',6 from dual union all
      select 'SAP_NEW','',7 from dual union all
      select '','Dialog',8 from dual union all
      select '','Service',9 from dual union all
      select '','System',10 from dual union all
      select '','Communication',11 from dual union all
      select '','Reference',12 from dual union all
      select 'SAP_FIR_EMER','',13 from dual union all
      select 'SAP_ALL','',14 from dual union all
      select '','Dialog',15 from dual union all
      select '','Service',16 from dual union all
      select '','System',17 from dual union all
      select '','Communication',18 from dual union all
      select '','Reference',19 from dual union all
      select 'SAP_NEW','',20 from dual union all
      select '','Dialog',21 from dual union all
      select '','Service',22 from dual union all
      select '','System',23 from dual union all
      select '','Communication',24 from dual union all
      select '','Reference',25 from dual union all
      select 'SAP_FIR_EMER','',26 from dual
select *
from tt;And, the input data look like ->
SAP_TYPE     SAP_DET_TYPE        S_NO
SAP_ALL                             1
             Dialog                 2
             Service                3
             System                 4
             Communication          5
             Reference              6
SAP_NEW                             7
             Dialog                 8
             Service                9
             System                10
             Communication         11
             Reference             12
SAP_FIR_EMER                       13
SAP_ALL                            14
             Dialog                15
             Service               16
             System                17
             Communication         18
             Reference             19
SAP_NEW                            20
             Dialog                21
             Service               22
             System                23
             Communication         24
             Reference             25
SAP_FIR_EMER                       26And, expected output ->
SAP_TYPE     SAP_DET_TYPE        S_NO
SAP_ALL                             1
SAP_ALL      Dialog                 2
SAP_ALL      Service                3
SAP_ALL      System                 4
SAP_ALL      Communication          5
SAP_ALL      Reference              6
SAP_NEW                             7
SAP_NEW      Dialog                 8
SAP_NEW      Service                9
SAP_NEW      System                10
SAP_NEW      Communication         11
SAP_NEW      Reference             12
SAP_FIR_EMER                       13
SAP_ALL                            14
SAP_ALL      Dialog                15
SAP_ALL      Service               16
SAP_ALL      System                17
SAP_ALL      Communication         18
SAP_ALL      Reference             19
SAP_NEW                            20
SAP_NEW      Dialog                21
SAP_NEW      Service               22
SAP_NEW      System                23
SAP_NEW      Communication         24
SAP_NEW      Reference             25
SAP_FIR_EMER                       26How to achieve this in SQL?
Thanks in advance for your time.

Try
select nvl(sap_type, last_value(sap_type) ignore nulls over (order by s_no)) sap_type
,      sap_det_type
,      s_no
from tt
order by s_no
;It should work without the nvl function as well...
select last_value(sap_type) ignore nulls over (order by s_no) sap_type
,      sap_det_type
,      s_no
from tt
order by s_no
;Edited by: BobLilly on Jun 20, 2012 3:11 PM

Similar Messages

  • How to Achieve this in SQL Query?

    How to Achieve this ?
    I have a table with numeric value populated like this
    create table random_numeral (numerals Number(10));
    insert into random_numeral values (1);
    insert into random_numeral values (2);
    insert into random_numeral values (3);
    insert into random_numeral values (4);
    insert into random_numeral values (5);
    insert into random_numeral values (6);
    insert into random_numeral values (56);
    insert into random_numeral values (85);
    insert into random_numeral values (24);
    insert into random_numeral values (11);
    insert into random_numeral values (120);
    insert into random_numeral values (114);
    Numerals
    1
    2
    3
    4
    5
    6
    56
    85
    24
    11
    120
    114
    I want to display the data as follows
    col1 / col2 / col3
    1 / 2 / 3
    4 / 5 / 6
    11 / 24 / 56
    85 / 114 / 120
    Can anyone Help me?

    I hope there might be some simple way to do this and waiting for experts to reply.
    Try the below query.
    SQL> select * from random_numeral;
      NUMERALS
             1
             2
             3
             4
             5
             6
            56
            85
            24
            11
           120
      NUMERALS
           114
           100
           140
    14 rows selected.
    SQL> select a.numerals ||' / '||b.numerals||' / '||c.numerals from
      2          (select numerals,rownum rn1 from
      3          (
      4              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
      5              from random_numeral
      6          )
      7          where rn=1) a,
      8          (select numerals,rownum rn1 from
      9          (
    10              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
    11              from random_numeral
    12          )
    13          where rn=2) b,
    14          (select numerals,rownum rn1 from
    15          (
    16              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
    17              from random_numeral
    18          )
    19          where rn=0) c
    20  where   a.rn1=b.rn1(+)
    21  and b.rn1=c.rn1(+)
    22  /
    A.NUMERALS||'/'||B.NUMERALS||'/'||C.NUMERALS
    1 / 2 / 3
    4 / 5 / 6
    11 / 24 / 56
    85 / 100 / 114
    120 / 140 /
    SQL>Cheers,
    Mohana

  • How to achieve this tree table (displaying/modifying non leaf level details) ?? Image inside

    Region
    location
    Dept
    Budget Available
    Allot Budget
    Unused Budget
    Decision for unused budget
    US
    200$
    User Input
    NY
    100$
    User Input
    CA
    100$
    User Input
    HR
    50$
    User Input
    IT
    50$
    User Input
    ---------30$--------
    20$
    LOV
    Add to Location
    Use for Future Project
    Add to Region
    Spend as Bonus
    How to achieve this tree table ?
    My client wants that they should also be able to manage budge at Location or region level not only at the leaf(Dept) level.
    I did a lot of research and finally found out that the details can only printed at the leaf(Dept) level.......
    We can not hard code Region, locations and departments in table rows. When table tree is displayed we will only show all the regions... (US, UK, SA, IND, AUS, CAN,RUS, JPN.... etc..)
    For Example:
    Locations for US (NY, CA, OKH, WC...... etc.)
    Locaitons for UK (SC, ENG, WL..... etc)  and so on......
    Departments for CA (HR, IT, ADMIN, FIN, TRVL, OPRN........ etc. ..)
    Thanks in advance... It will be really great help if I get some breakthrough...
    -Rahul

    Hi,
    what if you add a transient attribute to those view objects? This way you don't need to change the table structure.
    Frank

  • How to achieve this process in SAP SD module??

    Hi,
    I want to know whether this kind of scenario could be achieved in SAP system SD module??
    We have only one material which the value or price is 10000USD, and this material could be only used 5 times. Everytime it is used, it will be goods issued in the system,  and its value will be decreased 2000USD, this means this material will be drawn back into system and its value will be showed as 8000USD.  And next time it will be 6000...4000...2000...0
    After 5 times this kind of process, then this material is no-used any more.
    I just want to know could 'Draw back' and 'decrease 2000USD everytime'  'show 'previous value - 2000' as new value every drawn back time' ....
    how to achieve this in SAP SD system??
    Thank you very much.

    Hi,
    This can be mapped in Foreign trade.You need to use Licensing functionality.Each  time you use it,  it  depreciate by document value.
    Thanks,
    Vrajesh

  • I don't want my Time Capsule to link ti Internet, does anyone know how to achieve this ? Thanks Don

    I don't want my Time Capsule to link to Internet, does anyone know how to achieve this ? Thanks Don

    Don,
    We have no idea how you have your network set up, or what devices other than a Time Capsule that you might have, so it it impossible to provide an answer for you based on what we know at this time.
    Can you provide some details so that we can understand how you have things setup, what devices that you have, etc?
    The Time Capsule does need to connect to the Internet to receive firmware updates from Apple, so you would be missing out on some significant things......like a recent important security update....if you try to configure the Time Capsule to connect in the way that you ask about.
    Backups will not be "automatic" if you configure the Time Capsule without an Internet connection. You will have to manually switch networks whenever you want to back up, and then switch back again to your "other" network for normal use. Quite a hassle for most users, even if it can be done.

  • How to achieve this using UWL

    Hi Friends,
    I have the following requirement for Travel request workflow and Invoice approval workflow. Please let me know how to achieve this.
    While sending a work item to sap inbox we will put the base BO in the task container right so that the approver can open the particular transaction.I need the same functionality in UWL but instead of the BO i need to place some link so that the user can open an iview or webdynpro application. Basically the user dont want to login to SAP GUI he needs everything to be done in Portal itself.
    Do we need to do some settings in tcode SWFVISU for this or do we need to change the associated xml file in UWL to provide the link to iview. Please advice.

    Hi,
    If i understand your requirement correctly, you want to place a link of BO in UWL but don't want that to get to SAP GUI. Right ?
    I think it's possible. We had ECC 6.0 and EP 6.0 with SP 11. And, we had the requirement of showing up the TRIP BO in UWL thru' an iVIEW. We tried the SWFVISU and it didn't work. But, i think this facility has been taken care in later service packs. Pl approach SAP and they should be able to help you out. I'm not sure about the details of the solution SAP provided us, but it worked for us..like there will be a button "Display XXXXXX" which infact opens up your BO in UWL without logging into GUI.
    Hope this helps.
    venu

  • How to achieve this photographic slide display/navigation

    Hi,
    I would like to know how to achieve the following:
    1. Go to
    http://www.corneliaadams.com/
    & then click on 'michael mundy' link. this opens up a page with
    a slideshow of photographs that i really love. I have very basic
    knowledge of scripting ,a nd i usually achieve my goals by
    modifying flas that i have seen or by following tutorials (as
    opposed to writing it myself). the great thng about the above
    version is taht the images slide to an exact position when you
    click on the forward or back arrows, and they slow down ever so
    slightly just before stopping. Can anyone point me in the right
    directoin with how to achieve this, or offer a tutorial. I am
    really starting from scratch, and would lik eto end up with the
    same clean and professional outcome.
    2. regarding the same above link, when you are at the main
    site, and then you click the michael mundy' link, what is it that
    happens, is it a new html popup page that opens of specified
    dimensions and the embedded swf is set to stretch to maximum
    width/height? or is it a lone swf that pops up (with no html page)?
    or is that impossible?
    Many Many Many thanks in advance,
    Cheska

    I hope there might be some simple way to do this and waiting for experts to reply.
    Try the below query.
    SQL> select * from random_numeral;
      NUMERALS
             1
             2
             3
             4
             5
             6
            56
            85
            24
            11
           120
      NUMERALS
           114
           100
           140
    14 rows selected.
    SQL> select a.numerals ||' / '||b.numerals||' / '||c.numerals from
      2          (select numerals,rownum rn1 from
      3          (
      4              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
      5              from random_numeral
      6          )
      7          where rn=1) a,
      8          (select numerals,rownum rn1 from
      9          (
    10              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
    11              from random_numeral
    12          )
    13          where rn=2) b,
    14          (select numerals,rownum rn1 from
    15          (
    16              select numerals,mod(row_number() over(partition by 1 order by numerals),3)
    17              from random_numeral
    18          )
    19          where rn=0) c
    20  where   a.rn1=b.rn1(+)
    21  and b.rn1=c.rn1(+)
    22  /
    A.NUMERALS||'/'||B.NUMERALS||'/'||C.NUMERALS
    1 / 2 / 3
    4 / 5 / 6
    11 / 24 / 56
    85 / 100 / 114
    120 / 140 /
    SQL>Cheers,
    Mohana

  • How to achieve this specific drop shadow effect?

    Dear all,
    Does anybody know how to achieve this specific drop shadow effect in InDesign: a step by step instruction, a plugin, etc?
    Regards,
    Kasyan

    Kasyan,
    I generally just use the basic feather. I draw the object with a few clicks of the pen, fill with whatever color, set the tint if desired, then use settings more or less as below.
    Mike

  • How to achieve this Effect?

    Hey everyone i was wondering if you guys had any idea how to achieve this effect in flash.....http://www.youtube.com/watch?v=QftcJtvLr8g

    While you could probably do this in Flash, it is much more simply done using AfterEffects. There's a splendid text tool that can be tortured into effects like this. Have a look at the podcasts from Creative Cow on AfterEffects for some interesting examples.

  • Does anyone know how to achieve this in Photoshop? Any help is appreciated, thanks.

    Hello,
    I'm relatively new to Photoshop so if you know how to do this, please explain by telling me where I click. E.g. File>Open
    Does anyone know how I would achieve this exact effect in Photoshop in the image above (without the circular logo)? The 2 light blue type of effects, one at the top of the image, the one at the bottom of the image. I don't know how to achieve this effect, please show me if you know how. I'm using Photoshop CS5.
    I have looked through hundreds of tutorials, none provide me any clue as to how this is achieved.
    Or does anyone know a tutorial on how this effect is achieved?
    Thank you for your help.

    Yes, it would have been faster and more constructive to point out exactly where to find information rather than scold you.
    Check out the Option bar that one gets under the Menu bar. If it is not showing, go to windows>Options.
    More info: http://helpx.adobe.com/photoshop/using/tools.html#using_the_options_bar
    If you select the brush tool, you will notice a flow value, that you can lower; and a Mode drop down list.
    paint tool options: http://helpx.adobe.com/photoshop/using/painting-tools.html#paint_tool_options
    Set the mode to Linear Dodge, then for the next stroke set it to lighten.
    Blending modes explanations with links about their effects http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-77eba.h tml
    Have fun learning Photoshop!

  • In graph at the a particular value (threshold value) in Y-axis horizontal line have to display like a alert for the user. How to achieve this? (In WebI)

    How to achieve this in WebI?

    Just create a measure for it. Here's an example in E-Fashion:
    This is Sales Revenue for 2006; all I've done is added a new measure called "Target", which is just:
    =900000
    The chart is a combined chart. The Z Axis scale wasn't the same as the Y so I manually changed it to hard coded minimum and maximum values - you get the idea.
    HTH
    NMG

  • Particle effect -how to achieve this kind of effect exactly

    Hello   please help me to achieve this type of flickering particle effect.  how to achieve this in After effect  which is shown at 0.8 sec to 0.11  in the attached link video. http://www.istockphoto.com/stock-video-2682258-hearts.php

    I can't give you the exact settings but you could use Trapcode Particular with a custom particle or CC Particle world. Just turn gravity to 0 and set up a custom particle.
    Your particle layer will be behind the spinning hearts layer. This should get you going in the right direction.

  • How to achieve this OIC Calculation?

    Scenario likes this:
    Two dimensions:
    Dimension#1 Year Target Fulfillment Percentage
    Dimension#2 Discount (Selling Price/ List Price) for each transaction
    Ratetable is based on the two dimensions.
    So the formula is like this:
    Individually, no accumulative
    Input1: Year Target Fulfillment Percentage ( How to achieve this?)
    Input2: Discount (Easy to do)
    Is there anyone has any thought about it? The headache is when calculating the rate for each transactions (different discount), you need to know the whole year Target Fulfillment Percentage.
    帖子经 967311编辑过

    Hi,
    Sorry, I think I understand you now. You cannot do what you want because you cannot use Discoverer percentages to create a percentage based on a grand total from a different column. You can only create the percentages for Category A column based on the grand total for category A.
    To create the percentages that you want you can put the category A and Category B figures on a different row so that you only have one total column and use subtotals to calculate the totals for the categories. You can then create a Discoverer percentage for the total column to give you your category A and B percentages. You may need a row generator to create extra rows for the categories.
    The alternative is to use an analytic function in a calculation to calculate the grand total in the main query. For example:
    gtotal = SUM(Total) OVER ()
    Once you have the grand total you can then create percentage calculations, using:
    Cat A perc = Category A * 100/ gtotal
    Rod West

  • How to achieve this type of Writing

    I finally my Intuos tablet and I been trying to make this type of lettering, but I haven't had no luck. I been messing with the settings of the "Calligraphic" brushes and nothing. If someone out there knows how to achieve this and is willing to share the knowledge I'd be very helpful and I'd appreciate it it very much!
    http://img209.imageshack.us/img209/1186/typevl0.jpg
    Thanks!

    I'm afraid your expectations may be a bit unrealistic. That's not going to automatically happen by merely stroking away with a stylus using a Calligraphic Brush.
    Whether you're using a stylus or a mouse for your input device, that kind of text design is drawn deliberately and carefully with the Pen tool, creating paths along the edges of the glyphs.
    You
    might achieve a rough sketch as a starting point, but even then it would be better (and most probably easier) done by drawing centerline paths with the Pen and applying the Calligraphic Brush to those paths. Better still, start with a pencil sketch, scan it, and just start tracing that with the Pen. Tracing text is excellent practice for learning to use the Pen.
    JET

  • How to Achieve this Data Load into Cube

    Hi Experts,
    Could you please update me on how to achieve this
    I got a History data (25-35 Million Records) for about 8 years to be loaded to BW.
    What is the best approach to be followed
    1) Load everything into one cube and create aggregates or
    2) Create 4 different cubes (with same data model) and load load 2 years of data into each cune (2Years * 4 Cubes = 8 Years Data) and develop a multicube on top of 4 cubes
    If so how can i load data into respective cubes
    Ex: Lets assure i got data from 31.12.2007 to 01.01.2000 which is 8 years of data
    Now i created 4 Cubes--C1,C2,C3,C4 & C5
    How can i specifically
    load data from 01.01.2000 to 31.12.2001 (2 Years) to C1
    load data from 01.01.2002 to 31.12.2003 (2 Years) to C2
    load data from 01.01.2004 to 31.12.2005 (2 Years) to C3
    load data from 01.01.2006 to 31.12.2007 (2 Years) to C4
    load data from 01.01.2008 to 31.12.2010 (2 Years) to C5 (Currently Loading)
    Please advise the best approach to be followed and why
    Thanks

    If you already have the cube C5 being loaded and the reports are based on this cube, then if you donot want to create additional reports, you can go ahead and load the history data into this cube C5.
    What is your sourcesystem and datasource?. Are there selection conditions (in your infopackage) available to specify the selections? If so, you can go ahead and do full loads to the current cube.
    For query performance, you can create aggregates on this cube based on the fiscal period / month / year ( whichever infoobject is used in the reports)
    If your reports are not based on timeperiod, then multicube query will work as parrallelized sub queries and so there will be 4 dialog processes occupied on your BW system everytime the query is hit.
    Also any changes that you want to make in cube will have to be copied to all cubes, so maintenance may be a question.
    If there are enough justification, then approach 2 can be taken up

  • HOW TO ACHIEVE THIS IN BEX REPORT ?

    Hi
    I have a query like below:
    Indicator---Month---Volume--
    Revenue
    A--201101-10Tonnes----710USD
    A--201102-20Tonnes----2000USD
    Because of some selections in our query,It always displays data from beginning of year to present month(August).
    Now requirement is to add new column named 'Average'.....It should be weigted average and will be calculated as below:
    If we take records for 201101 month in cube....The calculations should be equivalent to  Volume of each record *  Revenue of each record / Total Volume for that month
    so if we take cube and display all records for 201101 month for example:
    Indicator--MonthVolume--Revenue
    A--2011011--
    100
    A--2011012--
    110
    A--2011013--
    200
    A--201101-4--
    300
    Then 'Average' that needs to be displayed in report for 201101 month will be calculated as follows:
    Volume for each record * Revenue for each record / Total Volume for that month
    (1100+21103*2004*300)/(123+4)=212
    So,the report will show 201101 as below:
    Indicator----Month--Volume-Revenue--Average
    A--201101-10710--
    212
    Similarly,if a report is executed for August month:
    Indicator----Month--Volume-Revenue--Average
    A--201101--10710--
    212
    A--201102--202000USD--300
    A--201103--303000usd---400
    A--201108--606000usd---700
    How can I achieve this in query designer?
    Regards.......

    Hi,
    Just tried looking into your query. Few questions that I have:
    1. When you say
    "if we take cube and display all records for 201101 month for example:
    Indicator--MonthVolume--Revenue
    A--2011011--
    100
    A--2011012--
    110
    A--2011013--
    200
    A--201101-4--
    300
    If these records are there in cube , then when you query on them the report will get aggregated based on you Indicator & Month. So no individual records to do the calculation.
    So I guess you should look for some routines while you are loading this records in the cube to do this calculation rather than Bex ...but I will feel good if someone can tell us to how to acheive it in Bex.
    Ankit

Maybe you are looking for