How to get this output using sql query?

Hi,
  How to get this output using sql query?
Sno Name Age ADD Result
1 Anil 23 delhi Pass
2 Shruti 25 bangalor Pass
3 Arun 21 delhi fail
4 Sonu 23 pune Pass
5 Roji 26 hydrabad fail
6 Anil 28 delhi pass
Output
Sno Name Age ADD Result
1 Anil 23 delhi pass
28 delhi pass

Hi Vamshi,
Your query is not pretty clear.
write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
Regards,
Kannan

Similar Messages

  • One for the Tekkies: How to get this output using REGULAR EXPRESSIONS?

    How to get the below output using REGULAR EXPRESSIONS??
    SQL> ed
    Wrote file afiedt.buf
      1* CREATE TABLE cus___addresses    (full_address                   VARCHAR2(200 BYTE))
    SQL> /
    Table created.
    SQL> PROMPT Address Format is: House #/Housename,  street,  City, Zip Code, COUNTRY
    House #/Housename,  street,  City, Zip Code, COUNTRY
    SQL> INSERT INTO cus___addresses VALUES('1, 3rd street, Lansing, MI 49001, USA');
    1 row created.
    SQL> INSERT INTO cus___addresses VALUES('3B, fifth street, Clinton, OK 74103, USA');
    1 row created.
    SQL> INSERT INTO cus___addresses VALUES('Rose Villa, Stanton Grove, Murray, TN 37183, USA');
    1 row created.
    SQL> SELECT * FROM cus___addresses;
    FULL_ADDRESS
    1, 3rd street, Lansing, MI 49001, USA
    3B, fifth street, Clinton, OK 74103, USA
    Rose Villa, Stanton Grove, Murray, TN 37183, USA
    SQL> The REG EXP query shouLd output the ZIP codes: i.e. 49001, 74103, 37183 in 3 rows.Edited by: user12240205 on Jun 18, 2012 3:19 AM

    Hi,
    user12240205 wrote:
    ... Frank, ʃʃp's method, I understand. But your method, although correct, I find it difficult to understand.
    Could you explain how you did this?? What does '.*(\d{5})\D*' and '\1' mean???
    Your method is better because it uses only ONE reg expression function. ʃʃp's uses 2.In Oracle 10.2 (I believe) and higher, '\d' is equivalent to '[[:digit:]]', and '\D' is equivalent to '[^[:digit:]]'. I find '\d' and '\D' easier to type, but there's nothing wrong with using '[[:digit:]]' and '[^[:digit:]]'.
    '.*' means "0 or more of any character".
    '\D*' means "0 or more non-digits".
    The whole expression, '.*(\d{5})\D*' means:
    a. 0 or more characters (any characters)
    b. 5 digits
    c. 0 or more non-digits.
    '\1' is a Backreference . It means the sub-string that matched the pattern after the 1st '(', up to (but not including) its matching ')'. In this case, that means the sub-string that matched '\d{5}', or b. using the explanation immediately above.
    So the entire REGEXP_REPLACE call means "When you see a sub-string consisting of a., follwed immediately by b., followed immedately by c., replace that sub-string with b. alone."

  • How to achieve this result using sql query?

    hello gurus,
    i have a table like this
    id    name
    1       a
    2       b
    3       c
    4       d
    5       e
    6       f
    7       g
    8       h
    9       i
    10     j
    11     k
    12     l
    13     m now my result should be like this
    id    name  id   name   id   name
    1       a     6       f      11     k
    2       b     7       g     12     l
    3       c     8       h     13     m
    4       d     9       i
    5       e     10      jhow to achieve it by sql query ?
    thanks and regards,
    friend
    Edited by: most wanted!!!! on Feb 22, 2012 5:55 AM

    hi,
    Did you mean this:
    with a as
    (select 1 id ,'a' name from dual
    union all select 2 id ,'b' name from dual
    union all select 3 id ,'c' name from dual
    union all select 4 id ,'d' name from dual
    union all select 5 id ,'e' name from dual
    union all select 6 id ,'f' name from dual
    union all select 7 id ,'g' name from dual
    union all select 8 id ,'h' name from dual
    union all select 9 id ,'i' name from dual
    union all select 10 id ,'j' name from dual
    union all select 11 id ,'k' name from dual
    union all select 12 id ,'l' name from dual
    union all select 13 id ,'m' name from dual
    select
      id_1
      ,name_1
      ,id_2
      ,name_2
      ,id_3
      ,name_3
    from
      select
        id id_1
        ,name name_1
        ,lead(id,5) over (order by id) id_2
        ,lead(name,5) over (order by id) name_2
        ,lead(id,10) over (order by id)  id_3
        ,lead(name,10) over (order by id) name_3
        ,rownum r
      from
        a
    where
      r <=5
    D_1                   NAME_1 ID_2                   NAME_2 ID_3                   NAME_3
    1                      a      6                      f      11                     k     
    2                      b      7                      g      12                     l     
    3                      c      8                      h      13                     m     
    4                      d      9                      i                                   
    5                      e      10                     j Regards,
    Peter

  • How to hide repeated details using SQL Query?

    How to hide repeated details using SQL Query?
    For Ex:
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    10 | BLAKE | CLERK |
    10 | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    20 | ADAMS | CLERK |
    20 | KING | SALESMAN|
    ------------------------+
    How we can display the above details in the following way?
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    | BLAKE | CLERK |
    | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    | ADAMS | CLERK |
    | KING | SALESMAN|
    ------------------------+
    Thanks Advance

    Hi,
    you can use BREAK ON DEPTNO in SQL*Plus or use LAG.
    SQL> ed
    Wrote file afiedt.buf
      1  select nullif(department_id
      2                , lag(department_id) over (partition by department_id order by last_name)
      3         ) dept_id
      4  , last_name, job_id
      5*  from employees where department_id in (30,50) and rownum <=10
    SQL> /
       DEPT_ID LAST_NAME                 JOB_ID
            30 Baida                     PU_CLERK
               Colmenares                PU_CLERK
               Himuro                    PU_CLERK
               Khoo                      PU_CLERK
               Raphaely                  PU_MAN
               Tobias                    PU_CLERK
            50 Fripp                     ST_MAN
               Kaufling                  ST_MAN
               Vollman                   ST_MAN
               Weiss                     ST_MAN
    10 rows selected.

  • How to get # of rows in SQL Query ResultSet

    I need to get the # of rows in a sql query resultset so I can create arrays of the size of the # or rows returned. This is how I do it so far. Is there a better way without running the query twice?
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
         i++;     
    aid = new int;
    i=0;
    rs = stmt.executeQuery(query);
    while (rs.next())
         aid[i] = rs.getInt(1);
    Theres actually a few more arrays but for this I just used one to show what I was doing. Notice stmt.executeQuery needed to be called twice, once to get the count to set the size of the array and once to get the values.

    nope - there's no easy way.
    the right thing to do is to iterate through the ResultSet, load its contents into a List of Objects or some other data structure, and close it out right away. You can get the count of rows while you do it. return the contents in the object or data structure for clients to use. you should never be passing a ResultSet around.
    why do you need to know, anyway?
    %

  • How to get this output format in ALV report

    Hi.
    Can any one pls let me know how to get the following output format in ALV report.Following are the outputfields
    companycode   location     position     approver
    300    800       01    watson
    null   null        03     candy
    null   null        04     smith
    null   null        05     michael
    one empty line after this again
    300     800     01     ryant
    null      null    02     gyan
    null      null    03     fermi
    null      null    04     ogata
    *Note: Null     indicates  empty space .( i.e I need to get empty space in  output where ever null is there.)
            Thanks in advance.
    Kind Regards,
    samiulla.

    hi,
    u can use 'REUSE_ALV_LIST_DISPLAY'
                           or
    'REUSE_ALV_GRID_DISPLAY'  function modules.
    SAMPLE CODE :
    *& Report  Y101982CHD
    *                         TABLES
    TABLES: vbak.    " standard table
    *                           Type Pools                                 *
    TYPE-POOLS: slis.
    *                     Global Structure Definitions                     *
    *-- Structure to hold data from table CE1MCK2
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF  BLOCK b1.
    *--Display option - block
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETERS: alv_list RADIOBUTTON GROUP g1,
                alv_grid RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF  BLOCK b2.
    *file download - block
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: topc AS CHECKBOX,
                p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF  BLOCK b3.
    *                      Initialization.                                *
    *                      At Selection Screen                            *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
        EXPORTING
          dynpfield_filename = 'P_FILE'
          dyname             = sy-cprog
          dynumb             = sy-dynnr
          filetype           = 'P'      "P-->Physical
          location           = 'P'     "P Presentation Srever
          server             = space.
    AT SELECTION-SCREEN ON s_vbeln.
      PERFORM vbeln_validate.
    *                           Start Of Selection                         *
    START-OF-SELECTION.
    *-- Fetching all the required data into the internal table
      PERFORM select_data.
    *                           End Of Selection                           *
    END-OF-SELECTION.
      IF t_itab1[] IS NOT INITIAL.
        IF topc IS NOT INITIAL.
          PERFORM download.
          MESSAGE 'Data Download Completed' TYPE 'S'.
        ENDIF.
        PERFORM display.
      ELSE.
        MESSAGE 'No Records Found' TYPE 'I'.
      ENDIF.
    *                           Top Of Page Event                          *
    TOP-OF-PAGE.
    *& Form           :      select_data
    * Description     : Fetching all the data into the internal tables
    *  parameters    :  none
    FORM select_data .
      SELECT vbeln
         posnr
         werks
         lgort
         INTO CORRESPONDING  FIELDS OF TABLE t_itab1
         FROM vbap
         WHERE  vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " select_data
    *& Form        : display
    *  decription  : to display data in given format
    * parameters   :  none
    FORM display .
      IF alv_list = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                               USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
       'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
       'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
       'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
       'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
    **        it_events                = t_alv_events[]*
            *it_fieldcat              = i_fieldcat[]*
          *TABLES*
            *t_outtab                 = t_itab1[]*
          *EXCEPTIONS*
            *program_error            = 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.*
      ENDIF.
      IF alv_grid = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                                 USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
         'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
         'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
         'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
         'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
            *it_fieldcat              = i_fieldcat*
          *TABLES*
            *t_outtab                 = t_itab1[]*
        *EXCEPTIONS*
       *program_error                     = 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.*
      *ENDIF.*
    ENDFORM.                    " display
    *& Form        : vbeln_validate
    *  description : to validate sales document number
    * parameters   :  none
    FORM vbeln_validate .
      DATA: l_vbeln TYPE vbak-vbeln.
      SELECT SINGLE vbeln
        FROM vbak
        INTO l_vbeln
        WHERE vbeln IN s_vbeln.
      IF sy-subrc NE 0.
        MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " vbeln_validate
    *& Form       :build_fieldcat
    * Description : This routine fills field-catalogue
    *  Prameters  : none
    FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                        USING   fp_field     TYPE slis_fieldname
                                fp_table     TYPE slis_tabname
                                fp_length    TYPE dd03p-outputlen
                                fp_ref_tab   TYPE dd03p-tabname
                                fp_ref_fld   TYPE dd03p-fieldname
                                fp_seltext   TYPE dd03p-scrtext_l
                                fp_col_pos   TYPE sy-cucol.
    *-- Local data declaration
      DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
    *-- Clear WorkArea
      wl_fieldcat-fieldname       = fp_field.
      wl_fieldcat-tabname         = fp_table.
      wl_fieldcat-outputlen       = fp_length.
      wl_fieldcat-ref_tabname     = fp_ref_tab.
      wl_fieldcat-ref_fieldname   = fp_ref_fld.
      wl_fieldcat-seltext_l       = fp_seltext.
      wl_fieldcat-col_pos         = fp_col_pos.
    *-- Update Field Catalog Table
      APPEND wl_fieldcat  TO  fpt_fieldcat.
    ENDFORM.                    "build_fieldcat
    *& Form        : download
    *  description : To Download The Data
    *  Parameters  :  none
    FORM download .
      DATA: l_file TYPE string.
      l_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
        TABLES
          data_tab                = t_itab1
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " download
    HOPE IT WILL HELP YOU
    REGARDS
    RAHUL SHARMA

  • How to insert the records using sql query

    hi,
    i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to  add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
    how can i solve this problem?
    Regards,
    M.Thippa Reddy

    You are not support use Insert / Update / Delete on SAP Databases directly.
    SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
    Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

  • How to get text of Last SQL Query

    Sorry if this has been covered, but the search page keeps erring on me.
    I am trying to figure out how to get the text of the last SQL statement executed (succesfully or unsuccesfully) by my current login.
    What it is, is i want in the exception handler of my procedure to be able to dump the text of the Query which was last run into the log file.
    Any help with this will be greatly appreciated!
    Thanks in advance,
    Aaron.
    [email protected]

    Well, ive been trying V$SQLTEXT in conjunction with V$SESSION and USERENV('SESSIONID'). This gets me my SQL statements, but the SQL_HASH_VALUE and PREV_HASH_VALUE, which are supposed to be the current and previous statements respectively always are the same and always point to the current statement..... is there some sort of flag you have to set to get PREV_HASH_VALUE (and PREV_SQL_ADDR) to actually point to the **PREVIOUS** statement??

  • How to get server output in SQL Developer

    I am learning SQL Deverloper and am using it in a University environment as well as Oracle test instances at Oracle.
    I know my way around SQL some but I am just learning PL/SQL.  I want to run an anonymous block and see output for the "dbms_output.put_line" items.
    At school, I enter my block in the "SQL Worksheet" and receive the "anonymous block completed" in the "Script Output" screen.  Then there is a 3rd screen, the name of which I cannot remember, but I believe it is the equivalent of "server output".  When I open it I have to tell it which database I'm using.  Then, I see the dbms output lines in this 3rd section.
    The problem is when I am using SQL Developer at work, I see only 2 sections:  "SQL Worksheet" and "Script Output".
    I have looked but cannot find an option or a button or a window that is called something like "server output" or "view server output."
    Can a more experienced user please help me?
    I am using:
    SQL Developer Version 3.1.07
            Build MAIN-07.42
    Linux x86-64
    (Oracle Internal:
    Instance: http://celalnx38.us.oracle.com:10507/
    tnsnames: 10500)

    Hi Makel,
    There are no changes of which I am aware in the Dbms_Output view functionality between the 3.2 and 4.0 releases.
    As to your point about confusion, keep in mind the following:
    1. Each Worksheet tab and Dbms_Output tab include the name of the connection in use.  Match on that name when checking output results.
    2. Opening multiple Worksheets on the same connection name will share one database connection by default.
    3. Multiple Worksheets sharing a database connection also share one Dbms_Output tab.  That is by design.
    To force worksheets to use unshared connections:
    4. Change the default behavior of (2) via Tools -> Preferences -> Database -> Worksheet -> New Worksheet to use unshared connection.
    5. Or avoid (4's) overhead of always using unshared connections by opening one-off unshared Worksheets: Ctrl + Shift + N from a shared Worksheet.
    Finally:
    6. When using unshared Worksheets, one Dbms_Output tab may be opened per unshared Worksheet.  Note that the names of any unshared Worksheets will appear in Dbms_Output's Select Connection dialog drop down list. That should avoid any confusion.
    Hope this helps,
    Gary

  • How to create this CSV in Sql query?

    I have a order_detail table with the primary key order_detail_id and the foregin keys order_id and product_id. Also I have three other fields, A, B and C, to describe the nature of this order detail. A product_id can be existed on different order_id
    but not in a single order_id (ie no duplicate product_id on a order). What I want the dataset to return is when passing the order_id, it could be single or multiple order_id, the query will give me the order_detail_id in comma seperate string if two or more
    of the same product_id found on the multiple order_ids and the same value on the other three fields, A, B and C, ie I would like to group by all the order_detail_id in a single row if those conditions are met.  Thanks a million. 
    Kahlua

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> I have a order_detail table with the PRIMARY KEY order_detail_id and the foreign keys order_id and product_id. <<
    WRONG. Order details are called weak entities in data modeling. They need a strong entity (the order) to exist. Therefore, the key has to include the order id as part of the PRIMARY KEY. There is no separate  “order_detail_id” in a correct model. 
    >> Also I have three other fields [sic], A, B and C, to describe the nature of this order detail. A product_id can existed on different order_id but not in a single order_id (i.e. no duplicate product_id on a order). <<
    Columns are not anything like fields. You need to learn basic terms. Here is what a polite person might have posted:
    CREATE TABLE Orders
    (order_nbr CHAR(15) NOT NULL PRIMARY KEY, 
    CREATE TABLE Order_Details
    (order_nbr CHAR(15) NOT NULL 
       REFERENCES Orders(order_nbr)
       ON DELETE CASCADE, 
     product_id CHAR(15) NOT NULL,
     PRIMARY KEY (order_nbr, product_id),
     order_qty INTEGER DEFAULT 1 NOT NULL
       CHECK (order_qty > 0), 
     -- special attributes
      alpha CHAR(5) NOT NULL,
      beta CHAR(5) NOT NULL,
      gamma CHAR(5) NOT NULL,
    >> What I want the data set to return is when passing the order_id, it could be single or multiple order_id, the query will give me the order_detail_id in comma separate string if two or more of the same product_id found on the multiple order_ids and
    the same value on the other three fields [sic], A, B and C, i.e. I would like to group by all the order_detail_id in a single row if those conditions are met. <<
    WRONG! You want to violate First Normal Form (1NF) and do display formatting in the database! You have not ever read a book or had a class on RDBMS. CSV? No! 
    Now, where is the sample data? More bad Netiquette! I have done this before; you can read the details at: 
    http://www.tdan.com/view-perspectives/5343
    It is a special case of a relational division. Since you did not post DDL, I will not post DML. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to get partition key using SQL

    I want to get the subpartition key of a Rang-List partition table in program.
    How to write the SQL.
    Thanks.

    Can you query against dba_tab_partitions & dba_part_key_columns?
    Edit: Misread the question, didnt see SUBpartitions. More coffee, less posting for me.
    Edited by: mrk on Dec 22, 2011 9:10 AM

  • How to get this output?

    I need to get the following output
    1
    2 3
    4 5 6
    7 8 9 10
    This is my code so far
            int j=0;
            int y = 0;
            for (int i = 1; i <= 4; i++) {
                if( i == y) i += 1;
                for (j = 0; j < i; j++) {
                    y = i+j;
                    System.out.print(y);
                System.out.println("");
            }And this is the output I get
    1
    23
    4567
    Any help?

    I don't understand the logic.
    what is this for?
    if( i == y) i += 1;by increasing i more than once per loop (including the i++ at for() part), you are decreasing the number of loops. That is why your output is only 3 lines.
    Message was edited by:
    Icycool

  • How to print this output. (Array)

    Hi all. I have two String array:
    String[] a = { "a", "b", "c", "d", "e" };
    String[] b = { "b", "d" };
    I want to print this two array into this output:
    Output:
    a
    bb
    c
    dd
    e
    Anybody can help me how to get this output. I have try with a for loop, but it's not working.

    try this,
    boolean found=false;
    for(int i=0; i<a.length;i++)
             found=false;
             for(int j=0;j<b.length;j++)
                     if(a.equals(b[j])
    found=true;
    if(found==true)
    System.out.println(a[i]+a[i]);
    else
    System.out.println(a[i]);

  • How do i get the approximate size of back up file required to save on disk using sql query because i want to show the required sapce for backup on my application

    hi i am face with problem that is i want to show the how much approximate space required for backup or .bak file to get backup using sql query because i want to show the required memory for backup file on my java application  

    Hi FIROZ
    TENNALI
    Is this still an issue, or can we close the thread?
    * closing a thread by marking the answer/s (there is a link beneath each response) and you can vote for useful responses as well (there is a link to vote on the left of each response)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How to create a Matrix table using this data in SQL Query Analyzer

    Hello all,
    I have a problem while I am trying to represent my Sql Table namely table1 in Matrix form
    my table Format is
    city1 city2 Distance--------------------------------------------------------
    Mumbai Delhi 100
    Delhi Banaras 50
    Mumbai Rajasthan 70
    Banaras haryana 40
    Mumbai Mumbai 0
    784 entries
    there are 784 cities each having link to other
    Now i want my output as
    Mumbai Delhi Banaras haryana
    Mumbai 0 100 -- --
    Delhi 100 0 50 --
    Banaras
    haryana
    respective distance from one city to other should be shown
    final Matrix would be 784*784
    I am using SQL Query Analyser for this
    Please help me in this regard

    I'm pretty much certain that you don't want to do this in pure SQL. So that means that you want to do it with a reporting tool. I'm not familiar with SQL Query Analyzer, but if it is in fact a reporting tool you'll want to consult its documentation looking for the terms "pivot" or perhaps "cross tab."

Maybe you are looking for

  • How do I log onto iCloud w/o going thru Apple support?

    I'm a little late to the transition of switching to iCloud via MobileMe and very much spoiled from having an easy access bookmark. Aside from going through Apple Support how do I log on ? I'm using System OSX 10.7.4 on my MacBook Pro and OSX 10.4.11

  • Pass value through URL without setting local page item

    Folks, I have a table where I have created a dummy column with a hyperlink on it to go to another page in the application which runs a report passing through columns on the table As I am doing this several times (for different pages in my application

  • "computer authorizations"

    Greetings. Forgive me if this has been answered before, but the search function seems inoperable at this time. When I click on my account in the iTunes music store, it says that there are "2 machines authorized to play music purchased with this (my)

  • Traversing up a tree

    i need help in traversing up a tree i want to start at a child node and traverse up the tree stoping when i find a certain value and return that node. In the example below i want to start at id 5 and stop when i traverse upwards when i hit the first

  • Resources: database design

    I'm looking for some nice resources for database design.  The people I work with don't understand this stuff, and won't take my word for it ("No way, it's a GOOD idea to have Value_1, Value_2,Value_3,..,Value_9 columns!" *smack*)... does anyone know