Write an select command 4 the pblm

hi frnz kindly help me to solve the pblm given below...
the table contains:
uid billno amount
1 101 100
2 102 200
3 103 300
the o/p shuld be:
uid billno amount total
1 101 100
2 102 200 *300*
3 103 300 *600*
kindly solve this without using the order command....... plz............

Another way but same.
  1  with t as (
  2      select 1 id, 101 billno, 100  amount from dual union all
  3      select 2, 102, 200  from dual union all
  4      select 3, 103, 300 from dual
  5      )
  6      select id
  7      ,      billno
  8      ,      amount
  9      ,      to_number(decode(sum(amount) over (order by billno,amount ),amount, null,
10            sum(amount) over (order by billno,amount ) ) )Cumm_amount
11*  from t
SQL> /
        ID     BILLNO     AMOUNT CUMM_AMOUNT
         1        101        100 (null)
         2        102        200         300
         3        103        300         600Using NULLIF
SQL>with t as (
  2      select 1 id, 101 billno, 100  amount from dual union all
  3      select 2, 102, 200  from dual union all
  4      select 3, 103, 300 from dual
  5      )
  6      select id
  7      ,      billno
  8      ,      amount
  9      ,     NULLIF(sum(amount) over (order by billno,amount ),amount) Cumm_amount
10*  from t
11  /
        ID     BILLNO     AMOUNT CUMM_AMOUNT
         1        101        100 (null)
         2        102        200         300
         3        103        300         600Ss

Similar Messages

  • How to write in selection screen after the select option field?

    Hi
    Please help me with this...
    i need to write format of date after the select option field in the selection screen.
    its like..
    date ___________  to ___________     <b>yyyymmdd</b>
    points will be awarded..
    thanx

    Use  selection-screen comment 1(31) text-005 -> this will give you format option.
    See the below sysntax ,you have to use like this
    Selection-screen begin of block b2 with frame title text-002.
    selection-screen begin of line.
    selection-screen comment 1(31) text-004.
    parameter:        r_1   radiobutton group rad1.
    selection-screen end of line.
    selection-screen begin of line.
    Aging  Report
    selection-screen comment 1(31) text-005.
    parameter:        r_2   radiobutton group rad1.
    selection-screen comment 40(30) text-003.
    parameter: p_expir as checkbox.
    selection-screen end of line.
    selection-screen begin of line.
    Materials with no Expiry Date
    selection-screen comment 1(31) text-006.
    parameter:        r_3   radiobutton group rad1.
    selection-screen comment 40(30) text-007.
    parameter : p_bin as checkbox ."default 'X'.
    selection-screen end of line.
    selection-screen end of block b2.
    selection-screen end of block b0.

  • SQL: combined SELECT-command possible???

    Hello Experts!
    in the enclosed SQL-command I'm actually selecting from table EKPO only the open POs with no reference in order-history (EKBE). Now I want to enlarge/combine this command in that way that additionally records from order history (EKBE) with a special movement type in EKBE are selected on top.
    Is it possible or do need a second select-command in the Z-application???
    THANKS for a response.
    Regards,
    Bernd
    select ebeln ebelp menge meins txz01 bukrs matkl
             werks matnr mtart labnr elikz pstyp from ekpo as b
        into (itab-bestnr, itab-pos, itab-best_mng,itab-meins, itab-text,
             itab-bukrs, itab-matkl, itab-werks, itab-matnr, itab-mtart,
             itab-labnr, itab-elikz, itab-pstyp)
        where ( mtart = 'ETMW' or mtart = 'ETVB' ) and
              menge > 0 and
              loekz <> 'L' and
              loekz <> 'S' and
              elikz <> 'X' and  " Endliefer-KZ
              ebelp not in ( select ebelp from ekbe where
                                    ebeln = b~ebeln ).
    Edited by: Bernd Thielemann on Jul 21, 2008 4:37 PM

    The result should be all open orders!
    1.) no EKBE
    2.) EKBE but quantity of goods receipt (WE) is less than quantity of the PO
    3.) intercompany-POs (stock transport order) have other movement types (like LFS and WA) which do not effect the status of the open PO until good-receipt movement is posted in the receiving plant .
    First/Second condition is realized. Third condition is the gap until now.
    Regards,
    Bernd

  • How to send more than one command at the same time to write buffer in VISA READ?

    Hi,
    I'm using the LABVIEW->serial.VI with a small modification for my serial communication with a shutter control unit.At present,I can send one command CTSO1 to the write buffer.My instrument can read upto 5 commands.I want to send CTSO1 and CTSO2 simulatenouly so that i could open two shutters simulatenously.Note that commands have carraige return constants as terminatting characters.I'm enclsoing the VI which works for one command.
    Any help in this regard is greatly appreciated!
    Regards,
    Rajesh
    Attachments:
    VI_SHUTTER_JUNE30.vi ‏50 KB

    You cannot do two different simultaneous VISA writes over a serial bus. There is a single rx line on the pc's com port and a single rx line on the instrument. You only hope is if the instrument allows you to chain commands and the reception of the carriage return triggers the instrument to implement both at the same time. Maybe you can send CTS01 and CTS02 separated by a space or comma. The manual should tell you if that's possible or maybe you need to ask the manufacturer.

  • Could not complete the new 3D extrusion from selected layer command because the path is too complex.

    I was trying to do a photo of mine like in this video but its not working help needed. thanks.
    http://www.youtube.com/watch?v=egyLY78H7nE
    When I tried the 3D I got an error message that said (could not complete the new 3D extrusion from selected layer command because the path is too complex.) what does this mean and how can i fix it?

    There was a bug at one time where really simple paths (like a triangle, for example) could cause that error.
    Is your path really simple (I don't plan to go watch the video)?  If so, have you installed the latest update for Photoshop?  That bug may have been fixed already.
    If it's not that, it's possible that if your path is really complex and simply exceeding Photoshop's capability.
    -Noel

  • TotalVHDCapacity attribute is returning zero in "Get-SCVMTemplate | select Name, TotalVhdCapacity" powershell command though the Vhd capacity is 20 gb in size, vmm 2012 r2

    Hi All,
    TotalVHDCapacity attribute is returning zero in "Get-SCVMTemplate | select Name, TotalVhdCapacity" powershell command though the template has Vhd capacity is 20 gb in size, vmm 2012 r2. I can create VM using this template too.
    For other templates it is returning correct value though.
    Can anyone help us understanding the root cause and the solution too.
    Thanks in advance.
    Debabrata

    I booted this drive from another computer (Asrock M3A770DE mobo) and works fine, speed with dd was ~100MB/s
    I also update bios on my first computer with Intel D945GSEJT (there is selected AHCI mode) still the same transfers with dd (~10Mb/s)
    I have no idea what to do with it now
    EDIT:
    More tests with other hdd (Samsung HD502IJ), dd on mounted NTFS partition:
    Intel D945GSEJT booted from Archlinux iso:
    hdparm: ~75 MB/s
    dd: ~10 MB/s
    Intel D945GSEJT booted from Archlinux iso, HDD connected to PCI SATA controller (Promise 378):
    hdparm: ~60 MB/s
    dd: ~10 MB/s
    Asrock M3A770DE booted from Archlinux iso:
    hdparm: ~87 MB/s
    dd: ~76 MB/s
    Asrock M3A770DE booted from Archlinux iso, HDD connected to PCI SATA controller (Promise 378):
    hdparm: ~81MB/s
    dd: ~76 MB/s
    What is broken on D945GSEJT?
    Last edited by miskoala (2012-03-30 13:47:23)

  • How to write selection Query for the following requirment.

    Hi All,
    I am new to ABAP, I need a help ,
    I need to select all plants(WERKS) from MARC at Plant/Material level,
    then I need to take all sales organozation(VKORG) from T001w,
    then I need the company code(BUKRS) from TVKO based on VKORG,
    then I need the currency key(WAERS) from T001 based on BUKRS,
    Can any one help me in writing selection Query for the same?
    Thanks All,
    Debrup.

    Hi,
    Its easy for you if you learn SELECT with JOIN to complete your task. So SEARCH the forum with SELECT statement and you will get a lot of examples using which you can write your own.
    If you struck up anywhere revert back.
    Regards
    Karthik D

  • Select Command Le check. Can't get the Le.

    Hello all.
    I have a question.
    I am making an applet.
    Into the Select command, I think my applet cannot get the Le data.
    The Le value has always '00' even though the select command Le value has been changed.
    First, in order to get the Le, I used the apdu.setOutgoing(), which returns Le, and then I checked the Le != 0.
    However, I think the setOutgoing() always returns '00' in my applet, and the applet does not perform the checking Le statement.
    I guess my testing environment or performing follow has a problem, but I am not sure.
    I want to hear your opinion and how to test in this case.
              short idl = apdu.setIncomingAndReceive();
              byte[] apduBuffer = apdu.getBuffer();
              short le = (short)(apdu.setOutgoing() & (short)0x00ff);
              if(apduBuffer[ISO7816.OFFSET_CLA] != CLASS_ISO)
         CardException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
              Util.arrayCopy(fileControlInformation, (short)0, transientData, TD_OFF_FILE_CONTROL_INFORMATION, (short)fileControlInformation.length);
              if((apduBuffer[ISO7816.OFFSET_P1]!=(byte)4) || ((apduBuffer[ISO7816.OFFSET_P2]!=(byte)0)))
         CardException.throwIt(ISO7816.SW_INCORRECT_P1P2);
              if((apduBuffer[ISO7816.OFFSET_LC] == (byte)0) || (idl == (short)0) || (apduBuffer[ISO7816.OFFSET_LC] != (byte)idl) || (le != (short)0))
                        CardException.throwIt(ISO7816.SW_WRONG_LENGTH);
    For example,
    00A4040007xxxxxxxxxxxxxx01<<9000
    Although wrong Le is added, the applet returns 9000.
    I know why the applet returns 9000.
    The point is how to test it correctly.
    Thank you.
    글 수정: Jin

    not really, "select application" can return whatever you like, and most applets do return something: a file control information template (fci) giving the AID and other info (for an example, try to select a card manager). That's a good practice: because you can select an application with only part of an AID, the applet usually replies with this complete AID. [tell the card: "Hello ath", she will respond "Hello, understood, but if you want to know, my full name is Athena" :) ]
    Jin, can you post your whole process() algorithm for the select command, including: how are you returning data? do you use apdu.SendBytes() ?
    if you have a contactless card it is possible that Le is always zero, because according to iso7816 zero means "all available data".
    why? because a contactless card (or a T=1 card) can return any length without prior indication, so it does not need Le.
    or it might be a bug in your javacard implementation...
    You can use apdu.SetOutgoingLength() to indicate the real length of the response, and usually the card OS (below javacard) relies on that to create a 6CXX response if there's a problem.
    A workaround can be: Read Le in the apdu buffer at the correct offset, and send a 6CXX SW yourself if you're not satisfied with it.
    I'm expecting more details from you to fully understand the problem.

  • HT2474 how to operate the dock - when i pull up the dock Command Tab, the dock appears centre screen but  can select an item to open

    Hi
    I am trying to use the dock like i have seen on other screens, by pressing command and tab - i can pull up the dock so it appears and cycles through, but when i try and select an item it just disappears, i am holding hte command button when selecting it or it just disappears. any helps appreciated.
    thanks

    That's not the Dock.. the Dock is the thing at the bottom of the screen that shows apps and a trash can.
    Regarding command-tab, the window that brings up should show all running apps. As long as you hold down command, it will stay open. Selecting an item in that window should cause that app to come to the front. However, if the app in question does not have any open windows, there may not be much change on the screen, so you could miss it. Keep an eye on the menu next to the Apple menu, which has the name of the current app. Does that menu change to whatever app you selected using command-tab?

  • Command-clicking a layer does not select it in the Layer panel

    In earler version of PS, command clicking a layer in the artboard would select the layer in the layer pallet so it could be manipulated. This does not seem to be the case in CS6 (I'm getting the highest level group selected)

    Command key brings up the move tool. And you have different settings for auto-select in CS6 than in your previous version.
    Go check the settings for the move tool.

  • Write a SELECT statement in different ways is not the same thing!!!

    Let's take a look
    use AdventureWorks2012
    go
    dbcc freeproccache
    go
    and now select something
    select * from [HumanResources].[vEmployeeDepartmentHistory]
    go
    so, analyzing 'Compiled Plan'
    SELECT usecounts, cacheobjtype, objtype, text
    FROM Sys.dm_exec_cached_plans
    CROSS APPLY sys.dm_exec_sql_text(plan_handle)
    where cacheobjtype = 'Compiled Plan'
    ORDER BY usecounts DESC;
    GO
    and now let's write some SELECT in "fuzzy case"
    dbcc freeproccache
    go
    select * from [HUMANResources].[vEmployeeDepartmentHistory]
    go
    select * from [HumanRESOURCES].[vEmployeeDepartmentHistory]
    go
    select * from [HumanResources].[VEmployeeDepartmentHistory]
    go
    select * from [HumanResources].[vEmployeeDEPARTMENTHistory]
    go
    select * from [HumanResources].[vEmployeeDepartmentHISTORY]
    go
    SELECT * from [HumanResources].[vEmployeeDepartmentHistory]
    go
    select * FROM [HumanResources].[vEmployeeDepartmentHistory]
    go
    and now let's see compiled plans again
    SELECT usecounts, cacheobjtype, objtype, text
    FROM Sys.dm_exec_cached_plans
    CROSS APPLY sys.dm_exec_sql_text(plan_handle)
    where cacheobjtype = 'Compiled Plan'
    ORDER BY usecounts DESC;
    GO
    So, write a SELECT statement in different ways is not the same thing!!!
    Hope it'll be useful
    P.Ceglie

    Yes.  There is little or no query normalization that happens in front of the query plan cache.  It would be a performance tradeoff to parse and normalize the query before matching it to the cached plans.  The benefit of reducing the number
    of plans in the cache probably wouldn't be worth it. 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Count  the total of SELECT command to particular table

    Hi,
    Does anyone know how to count SELECT command for particular table in certain period, like one day / week / month ?
    Regards,
    Alianto

    Assuming you have a date column to differentiate, then something like:
    SELECT COUNT(*)
    FROM table
    WHERE date_column BETWEEN TO_DATE('20030119 00:00:00','yyyymmddhh24:mi:ss') AND TO_DATE('2003011923:59:59','yyyymmddhh24:mi:ss')will count records for Jan 19. Just substitute the appropriate range for what you want to count for the others.
    TTFN
    John

  • I write in greek as well as english on my mac (osx mountain lion) problem is, there is no spell checking on pages, and yes, i have added a greek dictionary in the library spelling folder. and i can also select it from the inspector. what's wrong?

    I write in greek as well as english on my mac (osx mountain lion) problem is, there is no spell checking on pages, and yes, i have added a greek dictionary in the library spelling folder. and i can also select it from the inspector. what's wrong?

    You need to give more details:
    1. What version of Pages?
    2. Where did you get the Greek dictionary from and exactly how did you install it?
    3. Are you applying the language to your text?
    Peter

  • How to write XSJS Select Query with input parameters

    Hello Experts,
    I am creating a xsjs file and in that file I am trying to write a Select Query based on a Calculation View
    I have tried it the following way:
    var query = 'SELECT TOP 100 \"Name\", \"Address\", \"City\", \"Country\" FROM \"_SYS_BIC\".\"Test.HL/AddressView\"'
        + 'WITH PARAMETERS(\'PLACEHOLDER\' = (\'$$P_Name$$\', \' Akhil \'),'
      + '\'PLACEHOLDER\' = (\'$$P_City$$\', \' Lucknow \'))';
    But it gives me the "Mixed spaces and tabs error".
    How should I write XSJS Select Query with input parameters?
    Regards,
    Rohit

    >But it gives me the "Mixed spaces and tabs error".
    Mixed spaces and tabs has nothing to do with the syntax of the statement. You used both spaces and the tab in the content - which JSLint doesn't like.  Remove the beginning spaces of each line and use only one or the other.
    The actual syntax of your statement doesn't look right.  The problem is that you are escaping the \ when you don't need to if you are using ' instead of " for your string.  You escape with \" in the first line but then escape with \' in the 2nd and 3rd line.  That is going to cause serious parsing problems with the command.

  • How to find out the selected item in the lsit

    Hi all,
    How to find out the selected item in the list,can any please post some examples which easy to understand,because iam not a good programmer

    This sample program uses a checkbox as selection,  you could also use a HOTSPOT.
    report zrich_0002 no standard page heading.
    data: imara type table of mara with header line.
    data: check_box(1) type c,  
       report_lines type i.
    start-of-selection.
    * Create the gui status with BACK button in standard place
    * and a READ button in the application toolbar
      set pf-status 'CHECK'. 
    select * into corresponding fields of table imara           from mara up to 100 rows.
    loop at imara.   
    write:/ check_box as checkbox, imara-matnr, imara-matkl.  
    hide imara-matnr. 
    endloop.
      report_lines  = sy-linno - 1.
    top-of-page. 
    write: 'List of materials'.  uline.
    top-of-page during line-selection.  write:  'Material.....'.  uline.
    at user-command. 
    case sy-ucomm.  
    when 'READ'.   
      check_box = space.    
    set pf-status 'CHECK' excluding 'READ'.
          do report_lines times.       
    read line sy-index field value check_box.    
       if check_box = 'X'.        
    write:/  'You have selected material',
    imara-matnr.       
    endif.   
      enddo. 
    endcase.
    Regards,
    Rich Heilman

Maybe you are looking for

  • 17 Macbook Pro, freezing while rendering video in FCP

    Hi I have a late 2008 Model MacBook Pro 17.  My Macbook keeps freezing during rendering in Final Cut Pro 7.  Its been doing this for 3 weeks or so.  I originally thought a SSD was the way to go, but I think I may really need a new processor.  Im a li

  • Dock.app Crashes on Yosemite

    After an upgrade from Mavericks to Yosemite, my system reports that the Dock.app is crashing.  These are the issues; Desktop Background is black and will not update via System Preferences Screen Saver does not launch and fails to use "Hot Corners" Sp

  • Caps Lock key problem please help me

    Sir i want to check the caps lock key on or off how can i do? Please help me Thanks in advance

  • Premiere Elements file type for Elements Organiser

    I use PSE13 organiser ( for pictures and movies) and editor. I recently purchased Premiere Elements 13 and have just edited my first movie. I would like to only access Premiere Elements via the Photoshop Elements organiser, but I am unsure what file

  • OBIEE 11.1.1.7.0 installation hangs at Creating Domain

    I am trying this installation for N times...Windows 7 professional environment, 6Gb memory. Did several tries suggested by forum and web... like temp directory env variable is C:\TEMP and C:\TMP, disabled antivirus, installed java 6 at c:\Java, insta