How to get the individual records

Table A
SNO DAY_FROM DAY_TO
1 1 3
Result:
DAY_FROM DAY_TO
1 3
2     3
3      3
Above mentioned Table DAY_TO value is 3 ,
So in that How to get the 3 individual records for above mentioned row.
Thanks in advance.
Edited by: UserK on Sep 11, 2009 8:14 AM

  1  with t as
  2  ( select 1 day_from, 3 day_to from dual)
  3  select day_from +level -1 day_from, day_to
  4  from t
  5* connect by level <= day_to
SQL>
SQL>/
  DAY_FROM     DAY_TO
         1          3
         2          3
         3          3

Similar Messages

  • How to get the previous record value in the current record plz help me...

    In my sql how to get the previous record value...
    in table i m having the field called Date i want find the difference b/w 2nd record date value with first record date... plz any one help me to know this i m waiting for ur reply....
    Thanx in Advance
    with regards
    kotresh

    First of this not hte mysql or database forum so don;t repeate again.
    to get diff between two date in mysql use date_format() to convert them to date if they r not date type
    then use - (minus)to get diff.

  • How to get the max record

    how to get the record with the max sequence no
    table as
    seq student mark
    1 A 10
    2 A 15
    1 B 20
    2 B 10
    1 C 30
    here is what i need
    seq student mark
    2 A 15
    2 B 10
    1 C 30

    i have used your query + some decode
    With t As
    Select 'A' st, 'X' Type,    1 seq,   001 marker_no, 10 mark From dual Union All
    Select 'A', 'X',    2,   001,       12 From dual Union All
    Select 'B', 'X',    1,   002,       10 From dual Union All
    Select 'B', 'X',    2,   003,       12 From dual Union All
    Select 'B', 'X',    3,   003,       15 From dual Union All
    Select 'C', 'X',    1,   001,       10 From dual Union All
    Select 'C', 'X',    2,   002,       15 From dual Union All
    Select 'C', 'Y',    3,   001,       20 From dual Union All
    Select 'C', 'Y',    4,   001,       10 From dual
    Select st,
           Sum (x_cnt) x_cnt,
           Max (x_seq) Keep (dense_rank Last Order By  x_seq) x_seq,
           max(x_marker_no) keep(dense_rank last order by x_seq) x_marker_no,
           max(x_mark) keep(dense_rank last order by x_seq) x_mark,
           sum(y_cnt) y_cnt,
           max(y_seq) keep(dense_rank last order by y_seq) y_seq,
           max(y_marker_no) keep(dense_rank last order by y_seq) y_marker_no,
           max(y_mark) keep(dense_rank last order by y_seq) y_mark
    from
        (Select st,
               decode(Type ,'X',1,0) x_cnt,
               decode(type ,'X',seq,0) x_seq,
               decode(Type ,'X',marker_no,0) x_marker_no,
               decode(Type ,'X',mark,0) x_mark,
               decode(Type ,'Y',1,0) y_cnt,
               decode(Type ,'Y',seq,0) y_seq,
               decode(Type ,'Y',marker_no,0) y_marker_no,
               decode(Type ,'Y',mark,0) y_mark
          From t
    Group By st;     
    /*this is the output
    st X_cnt X_seq X_marker_no X_mark Y_cnt Y_seq Y_marker_no Y_mark
    A  2     2     001         12     0     null  null        null
    B  3     3     003         15     0     null  null        null
    C  2     2     002         15     2     4     001         10
    ST      X_CNT      X_SEQ X_MARKER_NO     X_MARK      Y_CNT      Y_SEQ Y_MARKER_NO     Y_MARK
    A           2          2           1         12          0          0           0          0
    B           3          3           3         15          0          0           0          0
    C           2          2           2         15          2          4           1         10

  • How to get the last record from the database

    I am using MS Access database and Swings as GUI. I want to get the last record of a particular column from the table and store it as a varaible.

    Hi
    To get Last record of resultset, you have pass some parameter in constructor of CreateStatement.In such case Resultset should be scrollable and Readonly
    Example
    objStatement=objCon.createStatement ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    mwwResultSet=cwwStatement.executeQuery(mwwSqlQuery);
    while(mwwResultSet.next())
    if(mwwResultSet.isLast())
    //Fetch the required column record.
    String abc=mwwResultSet.getString(1);
    I think this will work. Try it.
    bye

  • How to get the last record of an internall table ....

    Hi All..
    i want to get the last record of an internal table itab, and i want the the value of the last record.

    Hi,
         Use describe statment.
    data: lv_line type i.
        Describe table itab lines lv_line.
        read table itab into wa_itab index lv_line.
    regards,
    Santosh Thorat

  • How to get the individual query terms?

    Is there a way in Intermedia to get the individual query terms that are expanded by intermedia after a query using stemming or fuzzy matching.
    Example: a query like "$distinguish" expands to distinguish, distinguished and distinguishes.
    CTX_DOC.MARKUP does the work but returns the complete contents (with markup) of the indexed column in stead of the query terms only.

      1  with t as
      2  ( select 1 day_from, 3 day_to from dual)
      3  select day_from +level -1 day_from, day_to
      4  from t
      5* connect by level <= day_to
    SQL>
    SQL>/
      DAY_FROM     DAY_TO
             1          3
             2          3
             3          3

  • How to get the last record??

    Hi, I now have to get only the last record from one table
    from MS Access.
    I was looking for the useful method from API, however,
    I cannot get it.
    How to get only the last record from one table ???
    Please help, thanks.

    In RDBMS, row order is really not relavent by iteself. Meaning there is no such thing as 'last record' unless it's in the context of a column (e.g. timeStamp).
    Of course, rows are inserted and stored in some natural order, but you cannot assume they'll come back the same way in a 'Select *' as they were entered.
    So, if you mean last row as in last inserted row, I would add a timestamp field that's set at insert, or use a autonumber column. Either way, have a column that will always contain the highest number or newest timestamp, and then you can build your where clause from that.
    For instance, in Access, I have an autonumbered field called 'fred', with other columns. If I want the last record, I simply use the following:
    select * from atable where fred in (SELECT max(fred) AS Max FROM atable);
    the 'where in' clause will filter to only those records in the subsequent select statment, which of course is only one, the max of the column fred.
    bRi

  • How to get the total record count for the report

    Hi,
    How can I get count of the total records shown in the report. When we set the report attributes, we have an option "Set Pagination from X to Y of Z"
    Does anyone know how can I get the Z value from APEX variables.
    I know we can use that query and get the count but I just want to know how we can use APEX Variables effectively.
    Thanks in advance.

    You write a loop, something like this:
    Go_block('B1');
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    First_Record;
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    Loop
      If :system.record_status in('CHANGED','INSERT') then
        -- modify the record here--
      End if;
      Exit when :System.Last_Record = 'TRUE';
      Next_Record;
    End Loop;
    First_Record;But be very careful-- If your block can fetch a large number of rows, (over 100), this loop can take a long time, and you should not use this method. The loop will continue fetching more rows from the database until all rows satisfying the query are retrieved.

  • How to get the total record count in ODI

    Hi
    I have the interface the are file to DB.
    The format is like this..
    HEADER
    DETAIL
    TRAILER
    Now will write the contains of file to DB,
    But i have to insert the total count ie numberof record written from file to DB in my Trailer record.
    can you tell me how can i get the total count of records in file and write it to trailer?
    Also, I want the interface to rollback the data if something fails will loading the data from file., ie. if there are 100 records in file and 50 got transfer and something fails i want to rollabck the 50 records from DB.???
    Thanks :)

    Hi
    You can design a flow for Full load flow and incremental flow from flat file to Table.
    Create a table at target database like.. (create table with last_execution and palce the V_FULL_LOAD value and LAST_EXECUTION_DT columns in last_execution table)
    Add faltfile as table in model, create a variable as V_FULL_LOAD and make sure that the default values is 01-01-1900
    Create one more variable like V_LAST_EXECUTION_DATE (in this variable write a case statement that if V_FULL_LOAD value is 'Y" then full load should happen and same time you should check that V_FULL_LOAD column is balnk then write insert statment else write update statement to update last_execution_dt column, similar for 'N')
    please provide your *personal mail ID*, i will send a doc file realted to your query.
    we have to tables present in work repository (SNP_STEP and STEP_LOG tables) using tables we can get how many records are inserted/updated and we can find how many records are not transfer and gor error.
    Thanks
    Phani

  • How to get the individual total for the Sales(t1),Cost of Sales,(t2),t1-t2

    Hello BW gurus,
    sorry for the incomplete question.
    This is how i need my report.
    Account Number     Key Figure Type     Company code     Plant     Sales Organization     Fiscal year/period     Z1/007.2006     Z1/008.2006     Z1/009.2006     Z1/010.2006     Z1/011.2006     Z1/012.2006
                             SALES     x1                         
                             SALES     x2                         
                             SALES     x3                         
                             SALES     x4                         
                             SALES     x5                         
                             SALES     x6                         
    Overall Result                         SALES     x1x2..x6
    Similarly i need to get the cost of sales and its overall results
    and then i have to get the gross margin as (Sales - Cost of Sales) for each fiscal period(columnwise).
    i got the Sales and Cost of Sales like this
    Plant     Sales Organization     Fiscal year/period
              SALES
              COST OF SALES
              GROSS MARGIN
              SALES
              COST OF SALES
              GROSS MARGIN
              SALES
              COST OF SALES
              GROSS MARGIN
              SALES
              COST OF SALES
              GROSS MARGIN
              SALES
              COST OF SALES
              GROSS MARGIN
              SALES
              COST OF SALES
              GROSS MARGIN
              SALES
              COST OF SALES
              GROSS MARGIN
    but i need all the sales data first and its total(S)
    and then all the cost of sales data and its total(C)
    and the gross margin (S-C) for individual fiscal period.
    Please reply ASAP.Quick help is appreciated.
    Thanks in advance,
    Regards
    Sam Mathew

    Hi Viraylab,
                     check  <b>VBAP-NETPR</b> field of table <b>VBAP</b>
    It gives the net price corresponding to a line item.
    Goto Tcode VA03.See the <b>item overview</b> tab U will get <b>Net Price</b> field for indivisual line item.
    Reward points if helpful.
    Regards,
    Hemant

  • How to get the original record Number in Multi-Record Block

    Hello Everyone,
    I know how to find the duplicate item in the multi-Record block,
    For Ex:
    Line_Num            Item_Name             Quantity
    1                           AA                      10
    2                           BB                      20
    3                           AA Here 3rd record Item_name is duplicated, I can able to check and display the message that 'Item is duplicated' ,I found from [sheikyerbouti.developpez.com/duplicates/duplicates.htm] .
    but I want to show along with original line number i.e 1 when the item_name is entered .
    Here I want to check the original Line_Num and want to display the message
    'Item is duplicated,Update quantity in Original Line 1'
    Can anyone help me to get this?
    Thank You.
    Regards,
    Guru.

    Hi Francois,
    Actually I want to check and show the message when the item_name is entered i.e WHEN-VALIDATE-ITEM TRIGGER.
    I put the following code in WHEN-VALIDATE-ITEM TRIGGER
    Declare
         curnum number;
         dupnum number;
         cur_item varchar2(100);
         v_alert_no number;
         p_linerec varchar2(100);
    Begin
    curnum := TO_NUMBER(:System.Trigger_Record);
    cur_item := :Lines.Item_number;
    First_Record;
    p_linerec := :Lines.Item_number;
    LOOP
    If p_linerec = cur_item then
         dupnum := :Lines.Line_num;
         set_alert_property('ALERT_STOP',ALERT_MESSAGE_TEXT,
    'Duplicate Item Found,Update QTY in Original line number '||dupnum);
       V_ALERT_NO := show_alert('ALERT_STOP');
       :LINES.ITEM_NUMBER := NULL;
    :LINES.ITEM_DESCRIPTION:= NULL;
    :LINES.ITEM_REVISION:= NULL;
    :LINES.ITEM_CATEGORY:= NULL;
    elsIF (:System.Last_Record = 'TRUE') THEN
         Go_Record(curnum);
         EXIT;
      ELSE
         Next_Record;
      END IF;
    END LOOP;
    End; But I am getting the following error,
    FRM-40737:Illegal Restricted Procedure
    FIRST_RECORD in WHEN-VALIDATE-TRIGGERand then
    its showing for first line itself.
    Duplicate Item found.Update QTY in Original line number 1so I put the condition
    If :Lines.Line_num > 1 then --Only to check when the block having more than one record.but now it checking from second record and displaying,
    Duplicate Item found.Update QTY in Original line number 2 --(instead of Update QTY in Original line number 1)Can you tell me how can I change the above code for my requirement?
    Thank you.
    Edited by: Gurujothi on 27 Mar, 2013 5:20 PM

  • How to get the Data Record Number in BI 7.0?

    Hi All,
    In our requirement we need to load the Data Record Number in the DSO. I got the Request ID and Data Packet Number but not the Data Record Number.
    Does anyone has any idea?

    Hi......
    When the data is activated in DSO, it is written to the table of active data, where it is then available for reporting. Requests are sorted by the key of the DataStore object, request ID, data package ID, or data record number.
    You just load the data to the DSO.....and activate it.......it will autometically get generated.......You cannot load it from one DSO to other beacuse in this case Change log table is used........and this filed is in active table..........I think you need this fir reporting purpose.....so load it and activate the DSO......then it will be available in your active table for reporting.........because reporting is done on active table.......
    Check this link :
    http://help.sap.com/saphelp_nw04s/helpdata/en/a9/49453cabf4ef6fe10000000a114084/frameset.htm
    Hope this helps you....
    Regards,
    Debjani....
    Edited by: Debjani  Mukherjee on Sep 16, 2008 5:22 PM
    Edited by: Debjani  Mukherjee on Sep 16, 2008 5:25 PM

  • [php+mysql] how to get the inserted record ID?

    Hi all,
    I have a standard php page that inserts a record in a mysql
    db.
    is there a way to save the record ID on a session variable
    just after
    storing the new record on the db? I would like to be able to
    get this
    record ID on a specific page where I would allow the user to
    print
    this specific record, by filtering the db by this session
    variable.
    I can use MX Kollection (last version, not PRO).
    TIA
    tony

    >...
    >mysql_query(...);
    >$_SESSION['lastId'] = mysql_insert_id();
    >HTH
    >Micha
    Hi Micha,
    I think that it a bit more complicated.
    I can't find any occurrence of that mysql call.
    I used MX Kollection INSERT FORM function.
    here is the code (partially):
    ===============================
    <? // Load the common classes
    require_once('../includes/common/KT_common.php');
    // Load the tNG classes
    require_once('../includes/tng/tNG.inc.php');
    // Make a transaction dispatcher instance
    $tNGs = new tNG_dispatcher("../");
    // Make unified connection variable
    $conn_test_conn = new KT_connection($tes_conn,
    $database_test_conn);
    // Start trigger
    $formValidation = new tNG_FormValidation();
    $tNGs->prepareValidation($formValidation);
    // End trigger
    // Make an insert transaction instance
    $ins_rl_test = new tNG_insert($conn_test_conn);
    $tNGs->addTransaction($ins_rl_test);
    // Register triggers
    $ins_rl_test->registerTrigger("STARTER",
    "Trigger_Default_Starter", 1,
    "POST", "KT_Insert1");
    $ins_rl_test->registerTrigger("BEFORE",
    "Trigger_Default_FormValidation", 10, $formValidation);
    $ins_rl_test->registerTrigger("END",
    "Trigger_Default_Redirect", 99,
    "2.php?idp1={id_rl}");
    // Add columns
    $ins_rl_test->setTable("rl_test");
    $ins_rl_test->addColumn("nome_rl", "STRING_TYPE", "POST",
    "nome_rl");
    $ins_rl_test->addColumn("cognome_rl", "STRING_TYPE",
    "POST",
    "cognome_rl");
    $ins_rl_test->addColumn("datanascita_rl", "DATE_TYPE",
    "POST",
    "datanascita_rl");
    $ins_rl_test->addColumn("cancellato_rl", "STRING_TYPE",
    "POST",
    "cancellato_rl");
    $ins_rl_test->addColumn("cancellato_data_rl", "DATE_TYPE",
    "POST",
    "cancellato_data_rl");
    $ins_rl_test->setPrimaryKey("id_rl", "NUMERIC_TYPE");
    // Execute all the registered transactions
    $tNGs->executeTransactions();
    // Get the transaction recordset
    $rsrl_test = $tNGs->getRecordset("rl_test");
    $row_rsrl_test = mysql_fetch_assoc($rsrl_test);
    $totalRows_rsrl_test = mysql_num_rows($rsrl_test);
    ?>
    ===========================
    as you can see, all data is processed by other functions in
    other
    included files.... :(.
    I think I need to better understand the TNG engine and try to
    create a
    little trigger that creates a session variable just after
    inserting
    the record in the db.
    I already tried to do so, honestly, but with really poor
    results.
    Ciao Micha. ;).
    tony

  • How to get the total record in the block before save them

    Hello,
    I need to recalculate the amout for all records in one block before saving them.
    How can I get it?
    Thanks for your helping

    You write a loop, something like this:
    Go_block('B1');
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    First_Record;
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    Loop
      If :system.record_status in('CHANGED','INSERT') then
        -- modify the record here--
      End if;
      Exit when :System.Last_Record = 'TRUE';
      Next_Record;
    End Loop;
    First_Record;But be very careful-- If your block can fetch a large number of rows, (over 100), this loop can take a long time, and you should not use this method. The loop will continue fetching more rows from the database until all rows satisfying the query are retrieved.

  • $FLEX$. references - how to get the actual record id as a reference

    Hello,
    I'm using the DFF with title 'Customer Information' from Receivables, which is on a customer account (hz_cust_accounts table). How do I retrieve the actual row's PK/cust_accounts_id or the account_number being edited on the page?
    I tried $FLEX$.ACCOUNT_NUMBER
    (since ACCOUNT_NUMBER was defined as a column in the DFF registration),
    but this didn't seem to work.
    ==
    Thanks. Gina.

    Gina,
    Can give us the details of what you are trying to achieve?
    It is unclear whether you are using the accout number as a segment in the DFF registered against customer accounts (Why would do that?). Are you trying to capture more information against one customer account number in a DFF?
    If you are in the customer account block and usually you get any value in that block with this notation:
    :BLOCK.ACCOUNT_NUMBER where block refers the current block you are in.
    Is this what you are looking for?
    Thanks
    Nagamohan

Maybe you are looking for

  • My finger print access to my phone is not working how do I repair it

    My finger print access on my iPhone was working now it is not.  How do I fix it?

  • Is it possible to pause uploading to iCloud photo library in iOS?

    When uploading photos to iCloud photo library from OS X, there is an option to pause the upload. This is useful to give your internet connection some respite (e.g. during periods where traffic management policies apply). I can't find such an option i

  • Payment query

    Hi I've recently signed up with BT after moving home, all great so far except the date of the first direct debit is the 15th so due around the 23rd. As I've just moved I simply don't have the funds in my account until I get paid which is the last Fri

  • STMS Route configuration in Three system Landscape with DEV,QA and PRD

    Hi We have Three system landscape.i.e DEV,Quality and PRD Before Somebody  configured the STMS by selecting standard two system land scape ( Dev and QAS) We Have Installed Production Server And Added into Existing STMS Configuration Now Three Systems

  • Videos in My Album

    I have a question and perhaps it's because I have not found how to do it. I keep reading in reviews and in product features about iWeb that you can create Albums in which you place photos and videos. I have not been able to do the later. I created a