Problem in selecting the count

This the query which gives output as
select substr(c.department_edesc,1,15)Department ,
     substr(a.employee_code,1,8)Code,
     substr(b.employee_edesc,1,20)Name ,
     SUBSTR(min(a.log_time),1,8) INTIEM,
     SUBSTR(max(a.log_time),1,8) OUTTIEM,
     substr(d.gate_edesc,1,9)Gate
     /* substr(e.company_edesc,1,15)Company */
     From hr_attendance_detail a, hr_Employee_setup b , hr_department_code c                ,hr_attendance_gate_code d , company_setup e
     where a.employee_code = b.Employee_code
     and a.company_code = b.Company_code
     and b.company_code = c.company_code
     and b.cur_department_code = c.department_code and a.attend_no in (select attend_no
from hr_attendance where To_char (attend_date, 'DD-MON-YYYY') = '17-AUG-2004'
and Company_code = a.company_code )
GROUP BY c.department_edesc, a.employee_code, b.employee_edesc, d.gate_edesc,e.company_edesc
DEPARTMENT CODE NAME INTIEM OUTTIEM GATE
ADMIN DEPARTMEN 0000110 Ashok JB Singh 10:32:29 16:37:21 RECEPTION
ADMIN DEPARTMEN 0000021 Sagar P. Upreti 09:53:24 09:53:24 RECEPTION
ADMIN DEPARTMEN 0000024 Rajendra Giri 11:12:08 17:25:21 RECEPTION
ADMIN DEPARTMEN 0000030 Ajab Bikram Bista 09:19:14 18:20:36 RECEPTION
SALES DEPARTMEN 0000005 Prabhakar S. Thapa 09:25:50 17:46:17 RECEPTION
SALES DEPARTMEN 0000006 Hemraj Bohara 09:11:36 16:42:50 RECEPTION
SALES DEPARTMEN 0000007 Bishnu Raj Tripathi 09:53:27 16:32:49 RECEPTION
SALES DEPARTMEN 0000008 Keshav Dhital 10:21:41 15:46:10 RECEPTION
SALES DEPARTMEN 0000011 Rup Narayan Mahato 10:12:15 17:27:08 RECEPTION
SALES DEPARTMEN 0000012 Mohan Dahal(Khatri) 09:13:39 17:50:06 RECEPTION
SALES DEPARTMEN 0000013 Surya Brd. Lama 10:20:43 15:55:36 RECEPTION
now I want to count the total no of in and out of each employee which is get from referance hr_attendance_detail table .
Desc hr_attendance_detail
Name Null? Type
ATTEND_NO NOT NULL VARCHAR2(20)
EMPLOYEE_CODE NOT NULL VARCHAR2(30)
LOG_TIME NOT NULL VARCHAR2(8)
LOG_MODE NOT NULL VARCHAR2(3)
GATE_CODE NOT NULL VARCHAR2(2)
MOVEMENT_CODE NOT NULL VARCHAR2(4)
COMPANY_CODE NOT NULL VARCHAR2(30)
BRANCH_CODE NOT NULL VARCHAR2(30)
CREATED_BY NOT NULL VARCHAR2(30)
CREATED_DATE NOT NULL DATE
DELETED_FLAG CHAR(1)
EREMARKS VARCHAR2(100)
NREMARKS VARCHAR2(100)
SYN_ROWID VARCHAR2(18)
The movement_code which has value M001 and m003 for in and m002 and m004 for out.
so plz add below sql query to the above first query so that I can use single query to select total in and total out.
select count(movement_code) from hr_attendance_detail where movement_code like 'M001' || 'M003'; /*for total in*/
select count(movement_code) from hr_attendance_detail where movement_code like 'M002' || 'M004';/*total Out*/

Thank you Mr.Sadheesh Kumar Manavalan But it shows error as following and for your kind information I am using Oracle 8i
SQL>
1 Select AllDetails.*, in.Movement_count, out.Movement_count
2 from
3 (select substr(c.department_edesc,1,15)Department ,
4 substr(a.employee_code,1,8)Code,
5 substr(b.employee_edesc,1,20)Name ,
6 SUBSTR(min(a.log_time),1,8) INTIEM,
7 SUBSTR(max(a.log_time),1,8) OUTTIEM,
8 substr(d.gate_edesc,1,9)Gate
9 /* substr(e.company_edesc,1,15)Company */
10 From hr_attendance_detail a, hr_Employee_setup b , hr_department_code c ,hr_attendance_gate_cod
11 where a.employee_code = b.Employee_code
12 and a.company_code = b.Company_code
13 and b.company_code = c.company_code
14 and b.cur_department_code = c.department_code and a.attend_no in (select attend_no
15 from hr_attendance where To_char (attend_date, 'DD-MON-YYYY') = '17-AUG-2004'
16 and Company_code = a.company_code )
17 GROUP BY c.department_edesc, a.employee_code, b.employee_edesc, d.gate_edesc,e.company_edesc) A
18 (select employee_code,count(movement_code) Movement_count
19 from hr_attendance_detail where movement_code like 'M001' || 'M003' group by employee_code) IN,
20 (select employee_code,count(movement_code) Movement_count
21 from hr_attendance_detail where movement_code like 'M002' || 'M004' group by employee_code) OUT
22* where Alldetails.employee_code=IN.employee_code and Alldetails.employee_code=Out.employee_code;
SQL> /
Select AllDetails.*, in.Movement_count, out.Movement_count
ERROR at line 1:
ORA-00936: missing expression

Similar Messages

  • TS2771 I have just fitted a new sreen and lcd to my ipod 4th gen everything is workink, but im having problems with selecting the upperscace  and also the back space i have done a full reset and every thing i have tried has not resolved the problem

    I have fitted a new screen and lcd to my ipod 4th gen and now I'm unable to select the uppercase on the key board also other key in the lower part of the screen are intermittent, I have now carried out a full reset and this has not resolved the problem, and the latest software is installed apart from this everything else is working can anyone help

    Have you restored the iPod to factory defaults/new iPod? If so then you have a hardware problem. Maybe a loose/brken connector or maybe something else.

  • Problem while selecting the data

    Hi,
    In my below code
    FORM select_data.
      DATA : i_viqmel TYPE STANDARD TABLE OF t_viqmel WITH HEADER LINE.
      DATA : i_viqmel1 TYPE t_viqmel OCCURS 0 WITH HEADER LINE.
      DATA : i_viqmel_n TYPE t_viqmel OCCURS 0 WITH HEADER LINE.
    **/ Notification Details
      SELECT qmnum qmdat ausvn erdat aufnr ausbs msaus qmart
      equnr kunum qmtxt strmn
      FROM viqmel INTO TABLE
      i_viqmel
      WHERE
      qmnum IN s_qmnum AND
      qmdat IN s_qmdat AND
      qmart IN s_qmart.
    select QMNUM MANUM MNGRP MNCOD MATXT PSTER FROM QMMA INTO TABLE GI_QMMA for all entries in i_viqmel
                            WHERE QMNUM = i_viqmel-QMNUM
                            AND   PSTER NE SPACE
                            AND   MNGRP EQ 'VISIT'
                            AND   MNCOD EQ 'ENVI'
                            AND   MATXT NE SPACE.
       IF SY-SUBRC EQ 0.
       SORT GI_QMMA ASCENDING BY PSTER.
      select CODEGRUPPE CODE KURZTEXT from qpct into table gi_qpct for all entries in GI_qmma where
                                                                       SPRACHE eq 'E'
                                                                     CODEGRUPPE eq 'VISIT'
                                                                    and code eq gi_qmma-mncod.
        endif.
    as per above code data is not coming in  GI_QMMA ,
    WHAT CAN BE THE PROBLEM.
    regards,
    zafar

    Hi Zafar,
    It could be internal table i_viqmel does not contain any entry, you can place SY-SUBRC after VIQMEL select statement as per below:
    FORM select_data.
    DATA : i_viqmel TYPE STANDARD TABLE OF t_viqmel WITH HEADER LINE.
    DATA : i_viqmel1 TYPE t_viqmel OCCURS 0 WITH HEADER LINE.
    DATA : i_viqmel_n TYPE t_viqmel OCCURS 0 WITH HEADER LINE.
    **/ Notification Details
    SELECT qmnum qmdat ausvn erdat aufnr ausbs msaus qmart
    equnr kunum qmtxt strmn
    FROM viqmel INTO TABLE
    i_viqmel
    WHERE
    qmnum IN s_qmnum AND
    qmdat IN s_qmdat AND
    qmart IN s_qmart.
    *--> Add sy-subrc
    if sy-subrc = 0.
    select QMNUM MANUM MNGRP MNCOD MATXT PSTER FROM QMMA INTO TABLE GI_QMMA for all entries in i_viqmel
    WHERE QMNUM = i_viqmel-QMNUM
    AND PSTER NE SPACE
    AND MNGRP EQ 'VISIT'
    AND MNCOD EQ 'ENVI'
    AND MATXT NE SPACE.
    IF SY-SUBRC EQ 0.
    SORT GI_QMMA ASCENDING BY PSTER.
    select CODEGRUPPE CODE KURZTEXT from qpct into table gi_qpct for all entries in GI_qmma where
    * SPRACHE eq 'E'
    CODEGRUPPE eq 'VISIT'
    and code eq gi_qmma-mncod.
    endif.
    endif.
    Hope this helps.
    Regards,
    Patrick

  • Select the count with a conditional

    In my OBIEE report, I created two columns, "# True" and "# False".  The data is coming from a field that contain either a "true" or a "false".  I basically need to do something like:
    SELECT COUNT(datafield) WHERE datafield = "true"
    and
    SELECT COUNT(datafield) WHERE datafield = "false"
    I tried playing around with the formulas and filters, but I couldn't find a way to do it.
    Any help would be creately appreciated.
    Thanks

    sum(case when datafield = "false" then 1 else 0 end)
    go for other one as above with changes

  • Problem in selecting the different fields from different text fields

    hi,
    Can anyone help me regarding my query.
    i have 3 select list columns separately and what i m trying is that when i select one field from first select list the related fields must only be available for me in the second select list and so on.
    Suppose i select EBSO as a product name from the first select list then only those thing should be visible to me in the second select list which is only related to EBSO only...and same wise with the third select list..
    If anyone has the clue for this pls help me.
    The only clue which i m finding is that to use the java scrpts but how to use is another difficulty for me.
    Regards

    I will explain this through an example.
    In my application I have created two Select Lists.
    The first select list is a select list with a submit
    P3_X allows selection of 1,2,3
    The page branch sets the value of P3_X with &P3_X. so that way the second select list knows what value it will be using.
    The second select list P3_Y is a dynamic query that says
    Select SCOL d, SCOL r from TEST1 where FCOL=:P3_X
    If you were to have a third select list you would make the second Select List also a submit and have the page branch also set P3_Y with &P3_Y.
    The third Select list would say select from where item=:P3_Y
    Does this answer your question?

  • Problem in Selecting the data from EKPO and KONV tables

    Hi Experts,
    Presently I am working on Report with Comparision-Sheet Between the vendor's Quotations. I have to display the Discount, Freight, Packing and Forwarding, Vat in Item level data based on the conditions made in PO.
    As per my Knowledge, Condition Types are stored in KONV Table. But there is no relation between KONV and EKPO tables.  So, I am unable to print the data for Discount, Freight, Packing and Forwarding, Vat... How can I get the values from EKPO and KONV tables?
    Thanks in Advance.
    Thanks n Regards,
    Muralikrishna.

    Don't recall if this is correct, but you may need the condition number from the header (EKKO) combined with EKPO-EBELP or other field as you key to access KONV (KNUMH and KPOSN).  My site doesn't run PP, so can't verify if the data is actually stored that, so just a possibility.

  • PXI 6220 - problems with the counter

    Hello all,
    I try to make a buffered counting with counter0 of my PXI card 6220, to count the speed of a motor through a photocell and a sticker over the pulley of the motor.
    I have wired my photocell at PFI8 (source) and I generate a pulse train that I have wired in PFI9.
    The input to the counter is a pulse train 5V high level - 0V low level.
    The problem is that the counter counts sometimes more than 1 pulse for every turn of the motor. However, apparently the pulse train looks ok.
    I don´t know what´s the problem.
    The rising slope of the pulses looks very nice so, I think I could discard it.
    I can suppose that in between pulses there are some glitches at a very high frequency that I cannot see (I have sampled this signal only at 800kHz and at this frequency there are no glitches), but maybe the counter yes, because it works at 20MHz.
    Somebody has experienced this problem. Sometimes ago, using a PCI6221, I solved a similar problem by activating the digital filtering, but it seems it is not possible to activate for this cards. Could somebody confirm it?
    Any ideas will be appreciated.
    Thank you very much in advance!!

    Pete;
    I agree that is a little strange.We don't have such problem reported on our Data Bases.
    A workaround you can try is to make a sinle pulse goes to the source, before start the buffered acquisition, and see if that makes the counter keeps reporting a 1 value.
    You can also try the same thing on another counter of the board to see if that problem is related to the counter you are using.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • Not intelligib​le problems with the counter

    I use
    Board: PCI-6601
    Soft: VB 5.0 and ComponentWorks 3.0
    For my task I use " Buffered Event Counting" mode. If the signal comes the first on "Source" and then on "Gate" all works wonderfully. But if the signal comes on "Gate" the first I receive mistake
    Error:-10920
    Context: Reading data
    Description: "One or more data points might have been lost during buffered GPCTR operations due to speed limitations of your system".
    It is very strange. I would like to see zero. Somebody can face with this problem? Or the counter cannot work in such mode?
    Thanks.

    Pete;
    I agree that is a little strange.We don't have such problem reported on our Data Bases.
    A workaround you can try is to make a sinle pulse goes to the source, before start the buffered acquisition, and see if that makes the counter keeps reporting a 1 value.
    You can also try the same thing on another counter of the board to see if that problem is related to the counter you are using.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • SQL JSTL  displat y the count ..  cant figure out how please help......

    Hi all,
    I facing a problem in displaying the count total.. My situation is that I run below query ..
    <sql:query var="jobs" dataSource="jdbc/test">
              SELECT COUNT(*) FROM applications where employerid = '12345610' GROUP BY job_id
              </sql:query>
              <c:forEach var="row" items="${jobs.rows}">
              <li> Count <span id="count"> [<c:out value="${row.??? )}]</span></li>
              </c:forEach>
    {code}
    when I run the same sql in sql prompt it gives me 10 groups with relevant counts.
    but I cant figure out how to do the same using JSTL sql.  in simple terms I want to display the count of each logical group ?  I have tried all I can wit my little knowledge on the subject..
    I will appreciate if someone could help me out please..
    Million Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I found the answer my self... It took me just a 4 sleep to find the answer ,,, a break and a coup of coffee did the job
    I chanced the code as below
    SELECT COUNT(*) as cnt FROM applications where employerid = '12345610' GROUP BY job_id
              </sql:query>
              <c:forEach var="row" items="${jobs.rows}">
              <li><a href="/test/servlet/Controller?param=Security">Security </a><span id="count">[<c:out value="${row.cnt }"/>]</span></li>

  • The Counter on Welcome page is not showing up. How to find it?

    Bottomest line is: My first Welcome page is not showing the Counter. I put a counter on it and nothing shows. I tried disassembling the page by lifting layers, and maybe I did it incorrectly, but I cannot find the errant Counter.
    I tried going to the menu and de-selecting the Counter and then selecting it again, but that did not fool iWeb. It did not put a second Counter on my Welcome page because it knows that Lorna already put one there and it does not care that to the average non-Superman eye, it is invisible.
    QUESTION:
    How do I find that invisible Counter? What must I do, or do better?
    — Lorna in Southern California

    Is the welcome page the page with the big picture of
    a flower overlaying everything, linking into your
    site? Your page source does show a counter to be
    present at location 34 pixels from top of page and 40
    pixels from the left, but you have the picture over
    it!
    .......... Lorna says ................................................
    Yes, that is the welcome page: the pink flower. What page source? How do you see a page source? Anyhow, I went to the Welcome page in iWeb and moved the pink flower picture to the side and out of the window. I see nothing! No Counter and no picture covering a Counter. The only picture I see is my pink flower picture.
    It is probably still counting, but you won't be able
    to see it. If you remove your picture (or make it
    smaller) and republish you will see it.
    .......... Lorna says ................................................
    But I have moved the pink flower picture away and have cleared the field and see nothing. I did not make the picture smaller; if I can just push it out of the way, why would I need to make it smaller? (I suspect I am missing something here.)
    Lorna in Southern California

  • Selecting the correct lot size...

    Hi,
    I have some problem in selecting the correct lot size, please help me solve it.
    The requirement of raw materials per month is 100nos. But the vendor cannot supply them in qty required by us but supply can happen in 1000nos. I cannot purchase all the quantities as materials cannot be kept in store for long period.
    Which type of lot size is suitable for this type of scenario. Is there any SAP standards available or configuration is required?
    Regards,
    Pavan

    Hi Pavan,
    This is not a lot size issue  , but a process issue.  You cannot choose a lot size unless you are clear what is the qty for which you expect  PR in this case?
    Once that is clear,  you  will get lot size as needed
    cheers
    Rav

  • Problem about selecting waveform in waveform graph

    Hi all:
    I am developing a project by Labview. Now I meet a problem about selecting the waveform in the waveform graph.
    I am not sure whether it is possible about my idea.
    for example:
    In the waveform graph,  the different waveforms from a couple of channels are displayed. and then I want to select one waveform of them, and corresponding data about this waveform are shown. 
    Thanks so lot
    regards

    hanwei wrote:
    1.  can I zoom in and out in that "waveform graph"??
    You can do this using the graph palette. Just make it visible. The middle control allows you to zoom.
    2.  can I display the plot array or plot index that I select in the waveform graph?
    You can connect the same wire that goes to the ActivePlot property node to an indicator.
    3.  I build a sample codes for my project, in which , I used a random number generater to simulate a DAQmx data collection, and generate a overlapping waveform in the waveform graph.
         but it seems the program is not stable, when i first run the codes, it is ok, and I can select the plot what I want. but after I stop and restart the program, there is error message about "Property Node".
         it seems something wrong about the "waveform graph properties"
    I attached my codes here, anybody know what wrong about it?
    For some strange reason the property node is "messed up". I've seen this happen sometimes with graphs. I don't know what causes it, and the only way I've found to fix the problem is to delete the graph, put a new one on the front panel, and recreate the property nodes. I've typically seen this happen when copying code from another VI that has a graph with property nodes, as I suspect you did. If you delete the graph, put a new one on there, and recreate the property node you should be OK.
    That said, a few comments regarding the code:
    The architecture seems to be a mish-mash of operations, and I'm thinking that you probably want to look at using a producer-consumer architecture. Your producer loop responds to events, and the consumer loop does your DAQ collection.
    You have a race condition with your use of the "size(s) 2" local variable.
    Avoid right-to-left wires.
    The method of creating your arrays seems convoluted. However, since you said you will actually be getting the data from a DAQ system, the actual project code will likely be considerably different.

  • Problem in printing the selected labels value in smartform-SD_PACKING.....

    Dear all,
    Iam trying to print the packing list using smarforms,
    T.Code - VL74 - After providing the input for the selection screen,
    eg. output_type - 0001.
         outbound.deliv - 80000834.
    In the "OUTPUT FROM HANDLING UNITS" screen, im getting the list of labels available for that selection.
    say for eg.
      HU         Ob Object key Out. Med Role Name 1        City            PkMtT PackMatls
    1000004002 01 0080000834 0001 1   WE   CALCADOS LTDA BENTO GONCALVES Z001  300026
      1000004003 01 0080000834 0001 1   WE   CALCADOS LTDA BENTO GONCALVES Z001  300026
    1000004005 01 0080000834 0001 1   WE   CALCADOS LTDA BENTO GONCALVES Z001  300026
    1000004006 01 0080000834 0001 1   WE   CALCADOS LTDA BENTO GONCALVES Z001  300026
    with the Selection check box attached to the first field, when i
    select the first and second HUs, it should be passed to the
    driver program, but im getting only one HU value passed into the driver program.
    In the driver program my code goes like below,
    REPORT ZSDPACKDR LINE-COUNT 100 MESSAGE-ID VV.
    TABLES: VBCO3, TVST.
    INCLUDE ZPALIDATA_PL.
    INCLUDE RVADTABL.
    DATA: RETCODE LIKE SY-SUBRC,             "Returncode
           XSCREEN(1) TYPE C.                 "Ausgabe Printer/Screen
    Internal table for lips
    DATA: lips_wa TYPE lips.
    DATA: int_lips LIKE lips_wa OCCURS 0 WITH HEADER LINE.
    *&      Form  ENTRY
          text
         -->RETURN_CODE  text
         -->US_SCREEN    text
    FORM ENTRY USING RETURN_CODE US_SCREEN.
       CLEAR RETCODE.
       XSCREEN = US_SCREEN.
       PERFORM PROCESSING USING XSCREEN.
       IF RETCODE NE 0.
         RETURN_CODE = 1.
       ELSE.
         RETURN_CODE = 0.
       ENDIF.
    ENDFORM.                    "ENTRY
    FORM PROCESSING USING PROC_SCREEN.
       PERFORM GET_DATA.
       CHECK RETCODE = 0.
    ENDFORM.                    "PROCESSING
    FORM GET_DATA.
      REFRESH: LVBPLK, LVBPLA, int_lips.
      CLEAR: LVBPLK, LVBPLA, int_lips.
       DATA: FM_NAME TYPE RS38L_FNAM.
       VBCO3-VENUM = NAST-OBJKY.                                "00000.....
       VBCO3-SPRAS = NAST-SPRAS.      "D
       VBCO3-KUNDE = NAST-PARNR.      "KUNDE
       VBCO3-PARVW = NAST-PARVW.      "WE
       VBCO3-PACKD = 'X'.
       CALL FUNCTION 'SD_PACKING_PRINT_VIEW_SINGLE'
         EXPORTING
           COMWA                    = VBCO3
         IMPORTING
           VBPLK_WA                 = LVBPLK
           VBPLA_WA                 = LVBPLA
           VBADR_TVST               = LVBADR                    "n_916660
         TABLES
           VBPLP_TAB                = LVBPLP
         EXCEPTIONS
           SHIPPING_UNIT_NOT_UNIQUE = 1
           SHIPPING_UNIT_NOT_FOUND  = 2
           OTHERS                   = 3.
       IF SY-SUBRC NE 0.
         RETCODE = 1.
         PERFORM PROTOCOL_UPDATE.
       ENDIF.
    in the above coding, i used SD_PACKING_PRINT_VIEW_SINGLE', but i tried with SD_PACKING_PRINT_VIEW also, but no values getting loaded in the importing structures. if im doing anything wrong, pls correct me.
    *CALL FUNCTION 'SD_PACKING_PRINT_VIEW'
    EXPORTING
       COMWA                         = VBCO3
      AUFTRAG_NICHT_LESEN           = ' '
      EXPORTDATEN_NICHT_LESEN       = ' '
    IMPORTING
      VBPLA_WA                      =
    TABLES
       VBPLK_TAB                     = LVBPLK
       VBPLP_TAB                     = LVBPLP
       VBPLS_TAB                     = LVBPLS
    EXCEPTIONS
      OBJECT_NOT_FOUND              = 1
      OTHERS                        = 2
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    The problem is:
    For any of the above function call,
    The VBCO3 itself im getting only one label number, hence it is processing for only one, i want to know how to pass on the multiple
    label number to this function call ie, in VBC03.
    meaning i would like to know, in which internal table , i can get the list of all the selected HUs, so that i shall loop this function call inorder get the appropriate output.
    kindly help me to sort this issues.
    Points assured.
    regs,
    Raja

    Dear Srihari,
    I wrote above code in first label(now i deleted do-enddo) only.
    first i  am moving seven lebels data into seven wa's.
    after that reading the first record and moving another itab(for printing at main window i.e. 8 label).
    clearly, there is no space problem..because instead puttting all the required field i put only customer name.
    Now it is printing well in first page with 8 labels(main window) also.
    But in the second Page it displays only 7 labels and not printing rest of the labels.
    for example my itab has 20 records it displays 8 labels in first page &
    next 7 labels in second page and not print the rest of the 5 labels i.e. it is not calling third page(?).
    code..
    CLEAR : WA1, WA2, WA3, WA4, WA5, WA6, WA7.
    loop at it_final into wa_final FROM 1 TO 7.
      if sy-tabix = '1'.
        wa1 = wa_final.
      elseif sy-tabix = '2'.
        wa2 = wa_final.
      elseif sy-tabix = '3'.
        wa3 = wa_final.
      elseif sy-tabix = '4'.
        wa4 = wa_final.
      elseif sy-tabix = '5'.
        wa5 = wa_final.
      elseif sy-tabix = '6'.
        wa6 = wa_final.
      elseif sy-tabix = '7'.
        wa7 = wa_final.
      endif.
      endloop.
       delete it_final from 1 to 7. 
    **Push every 8th row if it_final in it_main
        read table it_final into wa_final index 1.  "deleting 8th, 16th,... records
        if sy-subrc = 0.
          append wa_final to it_main.
         else.
          exit.
        endif.
    *Delete the rows from it_main which are present in it_final
      loop at it_main into wa_final.
        delete table it_final from wa_final.  "deleting 8 th row from it_final.
      endloop.
    Edited by: anurag.radha on Jan 6, 2012 1:09 PM

  • Select Count(*) from Sample_table - how to get the count using JDBC?

    Hi All,
    It would be glad if anyone could help me with this. The problem is that I have to get the 'count' of records selected from a arbitrary table say, 'sample_table'. Is that possible to form the SQL in JDBC as
    Select Count(*) from Sample_table
    and get the value of the count? If yes, how?
    Thanks in advance
    Prabz

    stmt = con.createStatement();
    ResultSet recordcnt_rs = stmt.executeQuery("Select Count (*) as record_ctr From Sample_table");
    recordcnt_rs.next();     
    record_ctr = recordcnt_rs.getInt("record_ctr");
    hope this helps.

  • Problem in finding the Duplicate as well as Non-Duplicate count

    Hi,
    I have a scenario where I have a table TABLEA which has 3 values
    10 ABC
    10 ABC
    20 DEF
    I want to pick up the duplicate count as wel as non duplicate count:
    I have used the following query:
    SELECT COUNT(*) FROM TABLEA A WHERE A.ROWID > ANY (
    SELECT B.ROWID FROM TABLEA B WHERE
    A.CODE=B.CODE)
    But I am finding problem in getting the non-duplicate count .
    Any help will be needful for me
    Edited by: user598986 on Sep 23, 2009 11:32 PM

    user598986 wrote:
    Hi,
    I have a scenario where I have a table TABLEA which has 3 values
    10 ABC
    10 ABC
    20 DEF
    I want to pick up the duplicate count as wel as non duplicate count:
    I have used the following query:
    SELECT COUNT(*) FROM TABLEA A WHERE A.ROWID > ANY (
    SELECT B.ROWID FROM TABLEA B WHERE
    A.CODE=B.CODE)
    But I am finding problem in getting the non-duplicate count .
    Any help will be needful for me
    Edited by: user598986 on Sep 23, 2009 11:32 PMHi,
    perhaps this query makes your job:
    HR: XE > select * from test_;
    NAME           SALARY HIRE_DATE START_DAT END_DATE
                          15-SEP-09 15-SEP-09
                          15-SEP-09 01-DEC-09
    john                  27-AUG-09 16-SEP-09 16-SEP-10
                          28-FEB-09 20-SEP-09
    Dave                2 17-JUN-08 16-SEP-09 02-JUL-11
                     1000 21-AUG-82 08-MAY-10
    6 rows selected.
    HR: XE > select count(hire_date), hire_date from test_
      2  group by hire_date;
    COUNT(HIRE_DATE) HIRE_DATE
                   1 27-AUG-09
                   1 21-AUG-82
                   2 15-SEP-09
                   1 28-FEB-09
                   1 17-JUN-08
    HR: XE > select count(id), id from
      2  (
      3  select hire_date, 'simple' id from test_
      4  minus
      5  select test_.hire_date, 'simple' id
      6  from test_
      7  where test_.hire_date In (Select hire_date FROM test_  GROUP BY hire_date HAVING Count(*)>1 )
      8  union all
      9  select test_.hire_date, 'double' id
    10  from test_
    11  where test_.hire_date In (Select hire_date FROM test_  GROUP BY hire_date HAVING Count(*)>1 )
    12  )
    13  group by id;
    COUNT(ID) ID
             2 double
             4 simple
    HR: XE > Regards,
    Ion

Maybe you are looking for

  • IMac with 3TB Fusion drive will not partition under Boot Camp

    I have a 27" iMac with a 3TB Fusion drive and I am using 10.8.4. I am trying to install Windows 8 Pro with Boot Camp.  Everything starts well enough, but once I get to "Create a Partition for Windows" and setting a 505 GB Windows partition, it begins

  • Closed Lid use with Internal Microphone

    Is it possible to configure the internal microphone so that I can use it when I'm running my MacBook Pro with the lid closed? I close the lid and attach the MacBook to a large external monitor and still want to use Skype.

  • Help: Export format from FCP for DVD Studio

    What settings do I export my 3 minute film so I can use DVD Studio Pro? (What size do I want if I want my film to be wide screen just like a professional DVD movie you buy at your nearest store?) Thank You!

  • Leopard 10.5.2 Upgrade To 10.5.4 Login Freeze

    As I could not find the problem or the "solution" to this anywhere, I wanted to post it to help others. We purchased a MacBook Pro 15" for our COO and I was tasked with connecting it to our Windows AD environment. Binding to the network worked well,

  • Unable to open CS4 - error 150:30

    I've been using CS4 just fine for a long time. Suddenly when I try to open it I get an error dialog telling me that my licensing has expired. Error code 150:30. As far as I can tell, nothing has changed. I tried uninstall and then reinstall from orig