How to use select max and min query..

hi gurus,
we have got a custom report for develoment.
the report has to fetch the max and min salarys department wise....
how to pick up max & min sal ansal from table pa0008.

Hi,
Try the following
select max(sal)
           min(sal)
           from <database table>
           into <internal table>
           group by department
           where <where condition>.
Here we assume that sal is the field holding the salary and department is the name of the field in the database table. Where condition is optional.
Hope this helps.
Regards,
Sachin

Similar Messages

  • How can i write max and min data online during acquisition

    Hello,
    I am not keen with programming and your help will be greatly appreciated.
    I make temperature acquisition from an IR camera and I record online 38 different spots at a frequency of 10 samples/min.
    I also record two temperatures from thermocouples at the same sampling rate.
    I would like to make the acquisition during 5 sec every 20 sec and extract the max and min temperature from the thermocouples and write these values in a text file like show below :
    Temp_max 5 sec 22.1
    Temp_min 5 sec 2.1
    Temp_max 10 sec 42.1
    Temp_min 10 sec 4.1
    Temp_max 15 sec 82.1
    Temp_min 15 sec 6.1
    I also would like to make the same with two or three different spots of the IR camera. I think that if I have a good solution for the thermocouple, I can make it for the camera.
    I use LabView 8.2 with NIDaqmx acquisition.
    Thank you in advance

    Hello Evrem,
    Thank you for your advice. In fact, I have already attended to the training course you mentioned. I should think about going to the module Basic II. I do not have problem to connect/pilot various type of instruments but I am not very efficient with loop and arrays !
    I am fine with the data acquisition and the timing and I can sort data during 5 sec with "Array max & min". Then, I can display all data. What I have problem to do is to extract the max & min from the array, keep these 2 values for being writtten in a file at the end of my loop and start again during the next 5-sec cycle. At present, I only have the last max & min results from the last acquisition !
    Any example of how recording max & min online during 5-sec cycle acquisition will be welcome.
    Best regards,
    Labdummy

  • How to get the max. and min. of a selection-option?

    hi experters
    I wonder if there is any way can fetch the max value and minimum value from a select-option?
    please hint, many thanks
    wanlei.sun

    a®s wrote:
    > Try this way
    >
    >
    > SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
    >
    > START-OF-SELECTION.
    > SELECT * FROM T001W INTO IT_T001W
    >        WHERE WERKS IN S_WERKS.
    >
    > SORT IT_T001W BY WERKS ASCENDING.
    > READ TABLE IT_T001W INDEX 1.
    > MOVE IT_T001W-WERKS TO V_WERKS_MIN. " MIN Value
    >
    > SORT IT_T001W BY WERKS DESCENDING.
    > READ TABLE IT_T001W INDEX 1.
    > MOVE IT_T001W-WERKS TO V_WERKS_MAX. " MAx Value
    >
    >
    > a®s
    Please try this.
    TABLES : t001w.
    SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
    data: lv_min type T001W-WERKS,
          lv_max type T001W-WERKS,
          lv_count type i.
    START-OF-SELECTION.
      sort s_werks by low.
      describe TABLE s_werks LINES lv_count.
      if lv_count = 1.
        lv_min = s_werks-low.
        lv_max = s_werks-high.
      elseif lv_count > 1.
        read TABLE s_werks index 1.
        lv_min = s_werks-low.
        if not s_werks-high is INITIAL.
          lv_max = s_werks-high.
        endif.
        READ TABLE s_werks INDEX lv_count.
        if lv_max is INITIAL.
          lv_max = s_werks-low.
        else.
          if lv_max < s_werks-low.
            lv_max = s_werks-low.
          endif.
        endif.
      endif.
      write :/ lv_min,
               lv_max.

  • How to get Max and Min in one line .

    Hi Guys
    I know the program which I did is stupid .. I am getting the result for max and min value?
    But I how can I get the value of km, h, lit in one line
    Equno..max_date,min_date,min_value_km..max_value_km....min_value_h...max_value_h...min_value_l...max_value_l
    with my program i am getting the vlaue of max and min value but not in one line.
    the main parameter is recdu which is KM,L,H
    Can anyone tell me the logic please
    REPORT ZFUEL LINE-SIZE 200 LINE-COUNT 75
    NO STANDARD PAGE HEADING.
    TABLES : equi,
    equz,
    imptt,
    imrg,
    eqkt,
    iloa.
    Type Declaration
    TYPES: BEGIN OF ty_data ,
    equnr type equnr, " Euipment no
    eqktx type eqkt-eqktx, " Equipment Text
    eqfnr type iloa-eqfnr, " Equipment Sort field
    idate type imrg-idate, " Measuring Date
    recdu type imrg-recdu, " Unit of measuring ='KM','L','H'
    recdv type imrg-recdv, " Counter reading data
    END OF ty_data.
    TYPES: BEGIN OF ty_final,
    equnr type equnr, " Equipment no
    eqktx type eqkt-eqktx, " Equipment Text
    eqfnr type iloa-eqfnr, " Equipment Sort field
    min_date type imrg-idate, " Min Date
    min_km type p decimals 2, " Max Km
    max_km type p decimals 2, " Min km
    t_max_min_km type i, " Total min_km-max_km
    max_date type imrg-idate, " Max Date
    min_hr type imrg-recdv, " Max hr
    max_hr type imrg-recdv, " Min hr
    t_max_min_hr type i, " Total min_hr-max_hr
    min_lit type imrg-recdv, " Max lit
    max_lit type imrg-recdv, " Min lit
    t_max_min_lit type i, " Total min_lit-max_lit
    fuel_con type p decimals 2, " Total_hrs / t_max_min_hr
    km_l type p decimals 2, " km / L
    lit_per_hr type i , " fuel comsumed / t_max_min_hr
    END OF ty_final.
    DATA: i_data TYPE TABLE OF ty_data, " internal table
    wa_data TYPE ty_data, " work area
    i_final TYPE TABLE OF ty_final, " internal table
    wa_final TYPE ty_final. " work area
    data: begin of itab occurs 0,
    num type i,
    end of itab.
    data: v_min_1 type i,
    v_max_1 type i,
    min_km like imrg-recdv,
    max_km like imrg-recdv,
    min_l like imrg-recdv,
    max_l like imrg-recdv,
    max_dt like imrg-idate,
    min_dt like imrg-idate,
    t_ma_mi type p decimals 2,
    V1 LIKE IMRG-RECDV ,
    V2 LIKE IMRG-RECDV .
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: p_equnr FOR equi-equnr ,"no-extension no intervals,
    p_idate FOR imrg-idate. "NO-EXTENSION NO INTERVALS OBLIGATORY,
    "p_recdu FOR imrg-recdu NO-EXTENSION NO INTERVALS default 'KM' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    TOP-OF-PAGE.
    FORMAT INTENSIFIED ON.
    WRITE:/1(40) ' INVESTMENT LIMITED '.
    WRITE:/50(40) ' FUEL CONSUMPTION REPORT ' CENTERED ,
    2 'Page', sy-pagno.
    FORMAT INTENSIFIED OFF.
    WRITE:/50(40) '----
    ' CENTERED .
    FORMAT INTENSIFIED ON.
    WRITE:/2 sy-datum COLOR 3, sy-uzeit .
    "WRITE:/1 S903-SPMON ."p_yearf.
    ULINE.
    "CENTERED.
    write: /2 'Date From :'.
    write: /2 'Equipment No :'.
    write: /2 'Unit :'.
    SKIP.
    ULINE.
    WRITE:/1 sy-vline,
    2 'EQUIP NO', 10 sy-vline,
    11 'NAME', 40 sy-vline,
    41 'min date', 50 sy-vline,
    51 'max date', 60 sy-vline,
    61 'min km', 70 sy-vline,
    71 'max km' , 80 sy-vline,
    81 't_max_min_km', 90 sy-vline,
    91 'min hr', 100 sy-vline,
    101 'max hr', 110 sy-vline,
    111 't_max_min_hr' , 120 sy-vline,
    121 'min lit', 130 sy-vline,
    131 'max lit', 140 sy-vline,
    141 't_max_min_lit', 150 sy-vline,
    151 'fuel con', 160 sy-vline,
    161 'km_l', 170 sy-vline,
    171 'lit_per_hr', 180 sy-vline.
    FORMAT COLOR 3 ON.
    ULINE.
    END-OF-PAGE.
    START-OF-SELECTION.
    select aequnr deqktx feqfnr eidate erecdu erecdv
    into table i_data
    from equi AS a
    inner join equz as b
    on aequnr = bequnr
    inner join iloa as f
    on biloan = filoan
    inner join imptt as c
    on aobjnr = cmpobj
    inner join eqkt as d
    on aequnr = dequnr
    inner join imrg as e
    on epoint = cpoint
    where a~equnr in p_equnr
    and
    e~idate in p_idate
    and
    e~recdu = 'KM'.
            SORT i_data BY equnr idate descending .
            loop at i_data into wa_data.
            max_km = wa_data-recdv.
            min_km = wa_data-recdv.
        at new equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'MAX KM',max_km EXPONENT 0 DECIMALS 2 color 7,wa_data-recdu .
        endat.
    at end of equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'MIN KM', min_km EXPONENT 0 DECIMALS 2 color 7, wa_data-recdu .
    endat.
    at end of equnr.
    write: / '----
    write: /50(80) 'Subtotal' COLOR 4 .
    write:/ '----
    endat.
    endloop.
    select aequnr deqktx feqfnr eidate erecdu erecdv
    into table i_data
    from equi AS a
    inner join equz as b
    on aequnr = bequnr
    inner join iloa as f
    on biloan = filoan
    inner join imptt as c
    on aobjnr = cmpobj
    inner join eqkt as d
    on aequnr = dequnr
    inner join imrg as e
    on epoint = cpoint
    where a~equnr in p_equnr
    and
    e~idate in p_idate
    and
    e~recdu = 'L'.
            SORT i_data BY equnr idate descending .
            loop at i_data into wa_data.
            max_km = wa_data-recdv.
            min_km = wa_data-recdv.
        at new equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'MAX LIT',max_km EXPONENT 0 DECIMALS 2 color 7,wa_data-recdu .
        endat.
    at end of equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'MIN LIT', min_km EXPONENT 0 DECIMALS 2 color 7, wa_data-recdu .
    endat.
    at end of equnr.
    write: / '----
    write: /50(80) 'Subtotal' COLOR 4 .
    write:/ '----
    endat.ENDLOOP.
    select aequnr deqktx feqfnr eidate erecdu erecdv
    into table i_data
    from equi AS a
    inner join equz as b
    on aequnr = bequnr
    inner join iloa as f
    on biloan = filoan
    inner join imptt as c
    on aobjnr = cmpobj
    inner join eqkt as d
    on aequnr = dequnr
    inner join imrg as e
    on epoint = cpoint
    where a~equnr in p_equnr
    and
    e~idate in p_idate
    and
    e~recdu = 'H'.
            SORT i_data BY equnr idate descending .
            loop at i_data into wa_data.
            max_km = wa_data-recdv.
            min_km = wa_data-recdv.
        at new equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'MAX H',max_km EXPONENT 0 DECIMALS 2 color 7,wa_data-recdu .
        endat.
    at end of equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'MIN H', min_h EXPONENT 0 DECIMALS 2 color 7, wa_data-recdu .
    endat.
    at end of equnr.
    write: / '----
    write: /50(80) 'Subtotal' COLOR 4 .
    write:/ '----
    endat.
    endloop.

    Hi Guys
    How can I split the max and min value with if condition for KM L AND H as below
    I am getting the km value correctly but rest fields for L and H (lit and hours) it is not ?
    Please comment.
    *APPEND wa_data to i_data.
            SORT i_data BY equnr idate descending .
            loop at i_data into wa_data.
            if wa_data-recdu = 'KM'.
            max_km = wa_data-recdv.
            min_km = wa_data-recdv.
            endif.
            if wa_data-recdu ='H'.
            max_h = wa_data-recdv.
            min_h = wa_data-recdv.
            endif.
            if wa_data-recdu ='L'.
            max_l = wa_data-recdv.
            min_l = wa_data-recdv.
           endif.
        at new equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,
            'Min KM',min_km EXPONENT 0 DECIMALS 2 color 7 ,
             'Min H',min_h EXPONENT 0 DECIMALS 2 color 7 ,
              'Min L',min_l EXPONENT 0 DECIMALS 2 color 7.
        endat.
    at end of equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,
            'Max KM', max_km EXPONENT 0 DECIMALS 2 color 7,
            'Max H', max_h EXPONENT 0 DECIMALS 2 color 7,
            'Max L', max_l EXPONENT 0 DECIMALS 2 color 7.
    endat.
    regards
    Piroz

  • How to get max and min salary in a table

    How to get max and min salary in a table

    SQL> select max(sal),min(sal) from emp;
      MAX(SAL)   MIN(SAL)
          5512        800
    SQL>

  • Thread use to find max and min in an array of objects??

    Hello everyone,
    I need to find the min and max int value in a array of Objects.
    This has to be done using threads--like divide the entire array into 10 or so blocks and find the local min and max in each block., Each block is run on a thread and finally comparing them to find the global max and min.How should I do this? I am new to Java programming and in particular to threads.
    Thanks for your time and patience in answering this newbie question.
    JP

    Hi,
    if i understand your problem, you have a big array with a lot of int values and you need to create a few arrays with a part of the big one in each, next each in a thread find the max and the min, next return the max and the min of each thread and compare these max and min to obtain the globals max and min?
    In that case you can create a class in which is your big array. you create a second class implementing Runnable, in its creator you put the instance of the
    first class and 2 int which are the beginning and the ending index. in this class add a method run in this method you create a loop to compare the current value to the max and min values, and you replace if you need to do. In the first class you put the main where you create a few instance of the second class in a thread :
         private Thread threadName = new Thread(new SecondClass(this, start, end));
    Next you start all these thread:
    threadName.start();
    At the end of the run method of the second class you have to write your result in the max and min fields of the first class(int type, you have to create it)
    Write it only if it's necessary (if the current max is > than the already existing max).
    I think it's complete!
    Sorry if it's not really easy to understand, I'm french, but you can answer if you have more questions.
    S�bastien

  • How i use start with and rollup both in one query

    hi master
    sir i use rollup function for subtotal but rollup not give tree
    for tree i want to use start with and connect by function
    but that query give error
    sir how i use both rollup and start with connect by in one query
    for tree wise subtotal
    please give me idea
    thanking you

    hi master
    thank for your reply
    sir i get accid and title from master table and balance from detial table then system give me error
    sir i send me all table and data with query and error
    Sir this is my master table
    SQL> desc chartofacc;
    Name Null? Type
    PARENT NUMBER
    CHILD NUMBER
    ACCID NOT NULL VARCHAR2(15)
    TITLE VARCHAR2(99)
    CAMPID VARCHAR2(2)
    ACTIVE NUMBER
    FSTATUS NUMBER
    Data
    Parent child accid
         1     K1
    1     11     K11
    11     1101     K1101
    11     1102     K1102
    11     1103     K1103
    11     1104     K1104
    11     1105     K1105
    11     1106     K1106
    11     1107     K1107
    11     1108     K1108
    11     1109     K1109
    11     1110     K1110
    11     1111     K1111
    11     1112     K1112
    11     1113     K1113
    11     1114     K1114
    1     12     K12
    12     1201     K1201
    12     1202     K1202
    12     1203     K1203
    1     13     K13
    13     1301     K1301
    1301     130101     K130101
    1301     130102     K130102
    1301     130103     K130103
    1301     130104     K130104
    1301     130105     K130105
    1301     130106     K130106
    1301     130107     K130107
    1301     130108     K130108
    1301     130109     K130109
    1301     130110     K130110
    1301     130111     K130111
    1301     130112     K130112
    1301     130113     K130113
    1301     130114     K130114
    1301     130115     K130115
    13     1302     K1302
    1302     130201     K130201
    1302     130202     K130202
    1302     130203     K130203
    1302     130204     K130204
    1302     130205     K130205
    13     1303     K1303
    1303     130301     K130301
    1303     130302     K130302
    1303     130303     K130303
    13     1304     K1304
    1304     130401     K130401
    1304     130402     K130402
    1304     130403     K130403
    1304     130404     K130404
    1304     130405     K130405
    1304     130406     K130406
    1304     130407     K130407
    1304     130408     K130408
    13     1305     K1305
    1305     130501     K130501
    1305     130502     K130502
    13     1306     K1306
    1306     130601     K130601
    13     1307     K1307
    1307     130701     K130701
    1307     130702     K130702
    1307     130703     K130703
    1307     130704     K130704
    13     1308     K1308
    1308     130801     K130801
    1308     130802     K130802
    1308     130803     K130803
    1308     130804     K130804
    1308     130805     K130805
    1308     130806     K130806
    1308     130807     K130807
    1308     130808     K130808
    1308     130809     K130809
    1308     130810     K130810
    1308     130811     K130811
    1308     130812     K130812
    1308     130813     K130813
    13     1309     K1309
    13     1310     K1310
    13     1311     K1311
    1311     131101     K131101
         2     K2
    2     21     K21
    21     2101     K2101
    2101     210101     K210101
    2101     210102     K210102
    2101     210103     K210103
    2101     210104     K210104
    21     2102     K2102
    2102     210201     K210201
    2102     210202     K210202
    2102     210203     K210203
    2102     210204     K210204
    21     2103     K2103
    2103     210301     K210301
    2103     210302     K210302
    2103     210303     K210303
    2103     210304     K210304
    21     2104     K2104
    2104     210401     K210401
    2104     210402     K210402
    2104     210403     K210403
    2104     210404     K210404
    2     22     K22
    22     2201     K2201
    2201     220101     K220101
    2201     220102     K220102
    2201     220103     K220103
    2201     220104     K220104
    2201     220105     K220105
    22     2202     K2202
    2202     220201     K220201
    2202     220202     K220202
    2202     220203     K220203
    2202     220204     K220204
    22     2203     K2203
    2203     220301     K220301
    2203     220302     K220302
    2203     220303     K220303
    2203     220304     K220304
    22     2204     K2204
    2204     220401     K220401
    2204     220402     K220402
    2204     220403     K220403
    22     2205     K2205
    2205     220501     K220501
    2205     220502     K220502
    220502     22050201     K22050201
    220502     22050202     K22050202
    220502     22050203     K22050203
    220502     22050204     K22050204
    22     2206     K2206
    2206     220601     K220601
    2206     220602     K220602
    2206     220603     K220603
    2206     220604     K220604
    2     23     K23
    23     2301     K2301
    2301     230101     K230101
    2301     230102     K230102
    2301     230103     K230103
    2301     230104     K230104
    2301     230105     K230105
    2301     230106     K230106
    2301     230107     K230107
    2301     230108     K230108
    23     2302     K2302
    2302     230201     K230201
    2302     230202     K230202
    2302     230203     K230203
    2302     230204     K230204
    23     2303     K2303
    2303     230301     K230301
    2303     230302     K230302
    23     2304     K2304
    2304     230401     K230401
    2304     230402     K230402
    2304     230403     K230403
    23     2305     K2305
    2305     230501     K230501
    23     2306     K2306
    2306     230601     K230601
    2306     230602     K230602
    2306     230603     K230603
    2306     230604     K230604
    23     2307     K2307
    23     2308     K2308
    2308     230801     K230801
    2308     230802     K230802
    2308     230803     K230803
    23     2309     K2309
    2309     230901     K230901
    2309     230902     K230902
    2309     230903     K230903
    2309     230904     K230904
    23     2310     K2310
    2310     231001     K231001
    2310     231002     K231002
    2310     231003     K231003
    23     2311     K2311
    2311     231101     K231101
    2311     231102     K231102
    2311     231103     K231103
    23     2312     K2312
    2312     231201     K231201
    2312     231202     K231202
    2312     231203     K231203
    2312     231204     K231204
    23     2313     K2313
    2313     231301     K231301
    2313     231302     K231302
    2313     231303     K231303
    2313     231304     K231304
    2313     231305     K231305
    2313     231306     K231306
    2313     231307     K231307
    2313     231308     K231308
    2313     231309     K231309
    2313     231310     K231310
    2313     231311     K231311
    2313     231312     K231312
    2313     231313     K231313
    2313     231314     K231314
    2313     231315     K231315
    23     2314     K2314
    2314     231401     K231401
    2314     231402     K231402
    2314     231403     K231403
    2314     231404     K231404
    2314     231405     K231405
    2314     231406     K231406
    2314     231407     K231407
    23     2315     K2315
    23     2316     K2316
    2316     231601     K231601
    2316     231602     K231602
    23     2317     K2317
    23     2318     K2318
    23     2319     K2319
    2319     231901     K231901
    2319     231902     K231902
    2319     231903     K231903
    2319     231904     K231904
    2319     231905     K231905
    2319     231906     K231906
    23     2320     K2320
    2320     232001     K232001
         3     K3
    3     31     K31
    31     3101     K3101
    31     3102     K3102
    31     3103     K3103
    31     3104     K3104
    31     3105     K3105
    3     32     K32
    32     3201     K3201
    32     3202     K3202
    32     3203     K3203
    32     3204     K3204
    32     3205     K3205
    32     3206     K3206
    32     3207     K3207
         4     K4
    4     41     K41
    41     4101     K4101
    4101     410101     K410101
    4101     410102     K410102
    4101     410103     K410103
    4101     410104     K410104
    4101     410105     K410105
    4101     410106     K410106
    4101     410107     K410107
    4101     410108     K410108
    4101     410109     K410109
    4101     410110     K410110
    4101     410111     K410111
    4101     410112     K410112
    4101     410113     K410113
    4101     410114     K410114
    4101     410115     K410115
    4101     410116     K410116
    4101     410117     K410117
    4101     410118     K410118
    4101     410119     K410119
    4101     410120     K410120
    4101     410121     K410121
    4101     410122     K410122
    4101     410123     K410123
    4101     410124     K410124
    4101     410125     K410125
    4101     410126     K410126
    4101     410127     K410127
    4101     410128     K410128
    4101     410129     K410129
    4101     410130     K410130
    4101     410131     K410131
    4101     410132     K410132
    41     4102     K4102
    41     4103     K4103
    41     4104     K4104
    4104     410401     K410401
    4104     410402     K410402
    4104     410403     K410403
    4104     410404     K410404
    41     4105     K4105
    41     4106     K4106
    41     4107     K4107
    41     4108     K4108
    4108     410801     K410801
    4108     410802     K410802
    4108     410803     K410803
    41     4109     K4109
    4109     410901     K410901
    4109     410902     K410902
    4109     410903     K410903
    41     4110     K4110
    41     4111     K4111
    4111     411101     K411101
    4111     411102     K411102
    4111     411103     K411103
    41     4112     K4112
    4112     411201     K411201
    41     4113     K4113
    4113     411301     K411301
    41     4114     K4114
    4114     411401     K411401
    4114     411402     K411402
         5     K5
    5     51     K51
    51     5101     K5101
    51     5102     K5102
    51     5103     K5103
    51     5104     K5104
    51     5105     K5105
    51     5106     K5106
    51     5107     K5107
    51     5108     K5108
    51     5109     K5109
    51     5110     K5110
    51     5111     K5111
    51     5112     K5112
    51     5113     K5113
    51     5114     K5114
         6     K6
    6     61     K61
         7     K7
    7     71     K71
    7     72     K72
    7     73     K73
    7     74     K74
    7     75     K75
    7     76     K76
    This is my detil table
    SQL> desc accbal;
    Name Null? Type
    ACCID VARCHAR2(15)
    YEARID NUMBER
    CRBAL NUMBER
    DRBAL NUMBER
    ENTDATE DATE
    BALID NUMBER
    Data in detail
    K1101     46291132     
    K1102     13182173     
    K1103     23784045     
    K1107     10001795     
    K1108     9083529     
    K1110     4224350     
    K1112     6696832     
    K1113     7963381     
    K1114     742766     
    K1201     1486082     
    K130104     1977616     
    K130106     736266     
    K130107     396673     
    K130108     42751     
    K130109     298362     
    K130110     187696     
    K130111     537     
    K130112     942     
    K130113     987     
    K130114     1272     
    K130115     40000     
    K130205     259941     
    K130303     177716     
    K130406     809719     
    K130408     1786091     
    K130701     301000     
    K130702     151200     
    K130703     7570     
    K130704     34400     
    K1308          
    K130801     5400     
    K130802     45000     
    K130803     10856     
    K130807     24300     
    K130808     16500     
    K130810     104500     
    K130811     60000     
    K130812     181000     
    K130813     1750000     
    K1309     1225565     
    K1310     2176259     
    K1311          
    K131101     788780     
    K410101          24926
    K410102          9545
    K410103          28500
    K410104          8192
    K410105          847
    K410106          37100
    K410107          2332
    K410108          9844
    K410109          7843
    K410110          9313
    K410111          1425
    K410112          6089
    K410113          15497
    K410114          5790
    K410115          4251
    K410116          22293
    K410117          855
    K410118          6497
    K410119          14996
    K410120          124214
    K410121          6713
    K410122          1567
    K410123          75821
    K410124          5085
    K410125          7125
    K410126          4342
    K410127          21485
    K410128          641111
    K410129          589
    K410130          50
    K410131          163900
    K410132          3849
    K4105          3946489
    K4107          100000
    K410801          972011
    K410802          1707806
    K410803          116450
    K4110          13113874
    K411101          98335
    K411102          32454
    K411103          53569
    K411201          25327406
    K411301          7143103
    K411401          4500000
    K411402          12754
    K5102          2120031
    K5103          13543810
    K5107          4596103
    K5108          5604493
    K5110          2008401
    K5112          2182778
    K5113          4748537
    K5114          556914
    K61          43297680
    Sir I use this query
    select lpad(' ',2*(level-1)) || to_char(child),title,sum(drbal),sum(crbal),
    from chartofacc, accbal
    where chartofacc.accid=accbal.accid(+)
    start with parent is null
    connect by prior child = parent
    group by rollup(substr(mas.accid,2,1),substr(mas.accid,3,1),substr(mas.accid,4,2),substr(mas.accid,6,2) ,chartofacc.accid,title,fstatus);
    sir this query not give me result and give me error this
    SQL> /
    from chartofacc, accbal
    ERROR at line 2:
    ORA-00936: missing expression
    Please give me idea how I get tree type subtotal tribalance
    Thanking you
    Aamir

  • How to get max and min of a varchar2

    there is a column clothes_size in table_1 where i need to get the max and min..how can i get the actual max and min if its datatype is varchar2(50) and not number..how can i do this so that once i have 2 or more clothes_size values returned i will only get the smallest or the largest. i assigned number values on each field and whats next??? any suggestion?
    clothes_size
    XS                1
    S                2
    M                3
    L                4
    XL                5
    XXL                6

    Examples of this approach:
    select min(cloth_size_2) min_size
         , max(cloth_size_2) max_size
      from (select case when cloth_size = 'XS' then 1
                        when cloth_size = 'S' then 2
                        when cloth_size = 'M' then 3
                        when cloth_size = 'L' then 4
                        when cloth_size = 'XL' then 5
                        when cloth_size = 'XXL' then 6
                   end as cloth_size_2
              from your_table);
    <br>
    select min(cloth_size_2) min_size
         , max(cloth_size_2) max_size
      from (select decode(cloth_size
                         , 'XS', 1
                         , 'S', 2
                         , 'M', 3
                         , 'L', 4
                         , 'XL', 5
                         , 'XXL', 6) cloth_size_2
              from your_table);

  • I am using Photoshop CC2014 15.00.  In the pop-up menu for the Fill command there is a place for Scripted patterns.  Within that part, the tree and the picture frame are grayed. Why?   I've seen demonstrations on how to use the feature but mine doesn't wo

    I am using Photoshop CC2014 15.00.  In the pop-up menu for the Fill command there is a place for Scripted patterns.  Within that part, the tree and the picture frame are grayed.
    Why?   I've seen demonstrations on how to use the feature but mine doesn't work.  I checked the updates and I have the current version.
    Thanks.      LM

    I am running CC 2014.2.1 and I've updated to Yosemite. Not seeing tree or frame as an option in the menu. Coworker still on Mavericks has it.

  • How to create snapshot portlet and snapshot query using server API

    How to create snapshot portlet and snapshot query using server API
    Regards
    Dheeraj

    Hi Sebastian,
    I have used the query and it is working fine. but, How could i include the headers of the query also in to the Excel Sheet.
    RehaanKhan. M
    see the method discussed here
    http://sqlblogcasts.com/blogs/madhivanan/archive/2008/10/10/export-to-excel-with-column-names.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Gantt chart: Don't know how to use the tooltipkeys and toolkeylabel

    I have a problem. Don't know how to use the tooltipkeys and toolkeylabel. I used jquery to select the gantt bars and on mouse over i was getting the task id "tid" then passing it to adf bean with serverlistener and showing a popup that is adf component with javascript. For positioning of the popup I used a button that has width and height 0 and has position absolute and gets the coordinates of the mouse.
    "div[et]" is a jquery selector that selects all the elements that have attribute et. I noticed that all the bars have that attribute as a few other attributes as well "part"...
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
            xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
        <af:document title="untitled1.jsf" id="d1">
            <af:resource type="javascript" source="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"/>
            <af:resource type="javascript" source="resources/js/home.js"/>
            <af:messages id="m1"/>
            <af:form id="f1">
               <af:commandButton text="commandButton 1" id="cb1" inlineStyle="visibility:hidden; width:0; height:0" />
                <af:popup id="noteWindow" contentDelivery="lazyUncached" binding="#{homeBean.popup}">
                    <af:noteWindow id="popupWindow">
                        <af:panelFormLayout id="pfl2">
                            <af:panelLabelAndMessage label="Task id" id="plam5">
                                <af:outputText value="#{homeBean.taskId1}" id="ot64"/>
                            </af:panelLabelAndMessage>
                            <af:panelLabelAndMessage label="Start Location Name" id="plam6">
                                <af:outputText value="#{homeBean.startLocation}" id="ot7"/>
                            </af:panelLabelAndMessage>
                            <af:panelLabelAndMessage label="Stop Location Name" id="plam7">
                                <af:outputText value="#{homeBean.stopLocation}" id="ot8"/>
                            </af:panelLabelAndMessage>
                            <af:panelLabelAndMessage label="tasktype" id="pla2m7">
                                <af:outputText value="#{homeBean.taskType}" id="ot9"/>
                            </af:panelLabelAndMessage>
                        </af:panelFormLayout>
                    </af:noteWindow>
                </af:popup>
                <af:serverListener type="jsServerListener" method="#{homeBean.serverEventHandler}"/>
                <dvt:schedulingGantt id="gantt1" value="#{bindings.PersonView1.schedulingGanttModel}" var="row"
                                     startTime="2011-07-04 00:00:00" endTime="2011-07-04 23:00:00" summary="gsg"
                                     showMenuBar="false" showToolbar="false" iconPlacement="left"
                                     showTasksAsDailyBar="false">
                    <f:facet name="major">
                        <dvt:timeAxis scale="days" id="ta1"/>
                    </f:facet>
                    <f:facet name="minor">
                        <dvt:timeAxis scale="hours" id="ta2"/>
                    </f:facet>
                    <f:facet name="nodeStamp">
                        <af:column sortProperty="#{bindings.PersonView1.hints.PersonId.name}" sortable="false"
                                   headerText="#{bindings.PersonView1.hints.PersonId.label}" id="c1">
                            <af:outputText value="#{row.PersonId}" id="ot1">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.PersonView1.hints.PersonId.format}"/>
                            </af:outputText>
                        </af:column>
                    </f:facet>
                </dvt:schedulingGantt>            
            </af:form>
        </af:document>
    </f:view>javascript:
    $(document).ready(bindEvents());
    function bindEvents() {
        $("div[et]").live('mouseover', function (e) {
             $('#cb1').css("position", 'absolute');
             $('#cb1').css("top", e.pageY-4);
             $('#cb1').css("left", e.pageX);
            var popup = AdfPage.PAGE.findComponentByAbsoluteId("noteWindow");
            var element = AdfPage.PAGE.findComponent("f1");
            var taskIdToPass = null;
            if ($(this).attr("tid") !=undefined) {
                 taskIdToPass = $(this).attr('tid').toString();
            } else {
                taskIdToPass = $(this).parent().attr('tid').toString();
            var param = {            taskId : taskIdToPass        };
            AdfCustomEvent.queue(element, "jsServerListener", param, true);
            if (!popup.isPopupVisible()) {
                var hints = {};
                hints[AdfRichPopup.HINT_LAUNCH_ID] = "cb1";
                hints[AdfRichPopup.HINT_ALIGN_ID] =  "cb1";
                hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_START;
                popup.show(hints);
        }).live("mouseout", function () {
            var popup = AdfPage.PAGE.findComponentByAbsoluteId("noteWindow");
            popup.hide();
    };My bean that is session bean:
    package view;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCDataControl;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.render.ClientEvent;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.ViewObject;
    public class HomeBean {
        private RichPopup popup;
        private String taskId1;
        private String startLocation;
        private String stopLocation;
        private long taskId;
        private String taskType;
        public HomeBean() {
            super();
        public void serverEventHandler(ClientEvent clientEvent) {    
            String taskIdString = clientEvent.getParameters().get("taskId").toString();
            this.taskId = Long.parseLong(taskIdString);
            DCDataControl dc1 = BindingContext.getCurrent().findDataControl("AppModuleDataControl");
            ApplicationModule am = dc1.getApplicationModule();
            ViewObject vo = am.findViewObject("PdTrfDayView1");  
            RowSetIterator rowSetIterator = vo.createRowSetIterator(null);
            Row[] rows = rowSetIterator.findByKey(new Key(new Object[] {taskId}), 1);
            Row row = rows[0];
           this.taskId1 =  row.getAttribute("PdTrfDayId").toString();
           this.startLocation = row.getAttribute("StartLocation").toString();
           this.stopLocation = row.getAttribute("StopLocation").toString();
           this.taskType = row.getAttribute ("PdTrfTypeId").toString();
            RichPopup.PopupHints ph = new RichPopup.PopupHints();
            vo.closeRowSetIterator();
        public long getTaskId() {
            return taskId;
        public void setPopup(RichPopup popup) {
            this.popup = popup;
        public RichPopup getPopup() {
            return popup;
        public String getTaskId1() {
            return taskId1;
        public String getStartLocation() {
            return startLocation;
        public String getStopLocation() {
            return stopLocation;
        public String getTaskType() {
            return taskType;
    }I am wondering If i can use setCurrentRow on the iterator that i create and use it for displaying on the popup instead of binding startLocation and stopLocation to the bean and if there is any benefit of that at all...
    Edited by: 897833 on Nov 24, 2011 11:37 AM

    Hi,
    To use tooltipkeys and tooltiplabel in gantt, you can add following code in managed bean
    public String[] getTooltipKeys()
    return new String[]{"columnA", "columnB", "StartDate", "EndDate"};
    public String[] getTooltipLabels()
    return new String[]{"A", "B", "Start Date", "End Date"};
    where , the string array in the ToolTipKeys represents the columns, of the table you have in the gantt component , and the string array in TooltipLabels displays the label you want to display for the table columns.
    In the jsff, you could call the bean methods as follows:
    tooltipKeys="#{GanttBean.tooltipKeys}"
    tooltipKeyLabels="#{GanttBean.tooltipLabels}"

  • Cursor help and Max and min help

    hello I have a couple of simple questions on cursors.  I am gathering data from an oscilloscope to determine amplitude.  I would like to set a cursor for a reference point.  however, when I set the cursor to the specific number BEFORE the sweep takes place, the cursor gets erased and I have to reset it after.  Also, my x-axis goes from 0-240.  is their anyway to get a high precision?  When I input (154) for the position, it rounds up to 160 and its essential for me to keep as much precision as possible.  I attaching some pictures. 
    Another problem I am having is I want to gather the position where the max point is.  I need this position to subtract it from a reference point so I can determine how far I am from the desired reference point.  I am currently using the express VI statistics. 
    Attachments:
    Max and Min.JPG ‏162 KB
    Cursor Help.JPG ‏82 KB

    At the risk of sounding like a grumpy old man.
    Post you code please-  You have a lot of issues with your coding style and it might take a bit of work to help you out.  I'm not sure from your pictures where your question is pointing.
    Also please post .png files they are prefered on this forum.  And what LabVIEW version are you using?
    Jeff

  • Get max and min values from waveform chart

    Hi all
    Ive got a waveform chart and want to display the max and min value for the graph. How do i get the respective values?? Im using LabView 8.2
    holla
    Attachments:
    Untitled 231_LV80.vi ‏23 KB

    Thanks Mike

  • How to use SQL OVER and PARTITION BY in OBIEE Expression Builder??

    Hi there,
    I want to create a new logical coulmn with the following SQL query.
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )
    How to use the OVER and PARTITION BY in OBIEE Expression Builder??
    Thanks in Advance

    hi bipin,
    We cant use by in Expression builder(rpd) .But use the same formula like this in Fx of answers
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) >OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )SUM(Inventory Detail.Qty by Detail,ITEM,Mydate)/SUM(qty by detail,item)
    First check the numerator whether it was giving correct results or not then go with denominator
    compare the results with sql that u have
    Let me know if that does work
    thanks,
    saichand.v
    Edited by: Saichand Varanasi on Jul 27, 2010 9:27 PM
    Edited by: Saichand Varanasi on Jul 27, 2010 9:28 PM

  • XY Graph-Setting Y-Scale visible to False still Shows Corresponding Y scale Max and Min

    Hi Guys,
    I use XY graph to display the data with 3 Y-scales.
    When I set any Y scale Visiblity property to False,its still display the Y scale Max and Min range Lines in plot area of the  Graph and making cross line or extra parralel line with other visible scales.
    Attached the screen shot  for ref.
    And I know the cross line may be due to different Y scales range setting.But XY graph should not display the invisible Y scales and its property  as well.
    please provide your suggestions to avoid that.
    Solved!
    Go to Solution.

    The scales and the lines associated with those scales are separate properties. I have never tried it, and right now I am not at a computer, but there should be properties for setting the grid line colors. Set them to transparent.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Printing comments- Critical parse failure: Extended graphic state resource missing

    Hello! When I try to summarize comments in Acrobat Pro 9.4.5 and print them along with the document like this: I get this message: The only way I can get the comments to print out is to choose Comments Only.  I'd like to be able to print one of the o

  • Preview not working in 10.6

    Preview not working in 10.6. Not able to open multiple JPG files. No problem in 10.5.7. Any solution?

  • Reporting on 0BCS_VC11

    Hi, I´m dealing with this virtual cube from BCS in BW. We have made a lot of queries on it, and all of them are working properly in BWdevelopment, but the problem arised when we transported them to BW production. Although the request didn´t present a

  • How to create inbound delivery for items with no confirmation control key.

    hi Please help me with this.. are there any user exits to create an inbound delivery for scheduling agreement items with no confirmation control key. my req is i have 12 items (me33 transaction) of them three have confirmation control key populated a

  • Reg: How to add Quotation No. in Notification Details.

    Hi Experts, I created a Quotation using BAPI, now I want to assign that Quotation to Notification No.(IW52). That field is in Display mode, So I cant use BDC. I used "BAPI 'BAPI_ALM_NOTIF_DATA_MODIFY"  & 'BAPI_ALM_NOTIF_DATA_ADD' to update the Quotat