How data form move one table to another table

Hai All

I have two tables and a table, I need to move data to another table.

First table t1 has 3fields
code, date, time

Second table t2 has 8fields

code, intimate, outtime, att_date, perin, intrinsically, perout, introut

The table t1, I need to move the data to the t2.

for example
Bartime bardate barcode

02/01/10 0011, 0815

02/01/10 0022, 0820

02/01/10 0011, 1130

02/01/10 0022, 1145

02/01/10 0011, 1230

02/01/10 0022, 1235

02/01/10 0011, 1645

02/01/10 0022, 1650

both depend on that data to store in this table t2 and I seem to like this


barcode timein intrinsically introut timeout date
0011 0815 1130 1230 1645 02/01/10

0022 0820 1145 1235 1650 02/01/10

Thanks and greetings

Srikkanth.M

I need to cursor for that pls tell me on how to use and get the sequential files

You don't need a cursor at all, you can do it with a single INSERT statement:

insert into table2 (barcode, bardate, timein, intrin, introut,timeout)
 select barcode, bardate,
        max(decode(rn,1,bartime,null)) timein,
        max(decode(rn,2,bartime,null)) intrin,
        max(decode(rn,3,bartime,null)) introut,
        max(decode(rn,4,bartime,null)) timeout from (
                         select barcode, bardate, bartime,
                                row_number() over (partition by barcode, bardate
                                                   order by bartime) rn
                           from table1)
group by barcode, bardate;

It works with a single employee and 9999999999999...

Max
http://oracleitalia.WordPress.com

Tags: Database

Similar Questions

  • How to move a specific tablespace data file from one directory to another

    Database: 10.2.0.1
    OS: generic
    Description of the problem: how to move a specific tablespace data file of one directory to another account of the database that is on the installer of Oracle Dataguard

    * Oracle is working on this issue, but at the same time opens the topic community so that community members can add their views, experience, or knowledge. This will strengthen again all the knowledge bases, including My Oracle Support and My Oracle Support Communities *.

    Published by: ram_orcl on August 16, 2010 21:21

    Dear ram_orcl,

    Please follow the procedures here;

    http://download-UK.Oracle.com/docs/CD/B19306_01/server.102/b14239/manage_ps.htm#i1034172

    8.3.4 Renaming a Datafile in the Primary Database
    
    When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
    
    The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
    
       1.
    
          To rename the datafile in the primary database, take the tablespace offline:
    
          SQL> ALTER TABLESPACE tbs_4 OFFLINE;
    
       2.
    
          Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
    
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf
          /disk1/oracle/oradata/payroll/tbs_x.dbf
    
       3.
    
          Rename the datafile in the primary database and bring the tablespace back online:
    
          SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE      2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            3>  TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
          SQL> ALTER TABLESPACE tbs_4 ONLINE;
    
       4.
    
          Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
    
          SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
          SEQUENCE# APP
          --------- ---
          8 YES
          9 YES
          10 YES
          11 YES
          4 rows selected.
    
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
    
       5.
    
          Shut down the standby database:
    
          SQL> SHUTDOWN;
    
       6.
    
          Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
    
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
    
       7.
    
          Start and mount the standby database:
    
          SQL> STARTUP MOUNT;
    
       8.
    
          Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
    
          SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
    
       9.
    
          On the standby database, restart Redo Apply:
    
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
            2> DISCONNECT FROM SESSION;
    
    If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
    
    ORA-00283: recovery session canceled due to errors
    ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
    ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'
    

    Hope that helps.

    Ogan

  • How the identity if one table used only by synonyms and not by any other subprogrammes in a schema?

    Hi people

    How the identity if one table used only by synonyms and not by any other subprogrammes within a schema. I see in the TOAD describe objects tab used by, but I would like to identify hundreds of table so I would like to know if there would be any SQL or Meta Data Tables?

    How the identity if one table used only by synonyms and not by any other subprogrammes within a schema. I see in the TOAD describe objects tab used by, but I would like to identify hundreds of table so I would like to know if there would be any SQL or Meta Data Tables?

    The ALL_DEPENDENCIES view has hierarchical information based on object_id

    The view object has the object_type.

    Create a hierarchical query on the first view and attach it to the second view.

    Or you can use the utldtree.sql file in the installation of the DB admin folder. Comments initially show you how a hierarchical query based on the object type.

  • How can I move an application to another screen

    How can I move an application to another screen

    Hold down the icon until they start to move. From there, you can tap the application that you want to move and drag it to the left or right to access the screen you want. Once you are finished, press the home button to complete the task and turn off the wiggle.

  • How can I move a control to another Panel?

    How can I move a control to another Panel. For example, I currently have a textbox control and command which I would like to move to a tab of the Panel buttons 2... Is there a way I can just change the Panel they sit rather than remove the controls I have and then create new controls on the tab?

    Maybe you want to make the trip in IDE, not by the program...

    It is very simple: select the controls that you want to move, Ctrl-x or select 'Cut' in the Edit menu, and then select the destination tab, press Ctrl + V (or select Paste from the Edit menu).

    That's all.

  • How nagivate values from one page to another page as well assured in different modules like po and pon

    How nagivate values from one page to another page as well assured in different modules like po and pon?

    I tried using the session values, hashmap, and Transaction. But none worked.

    Please help me on this.

    Dilip thanks.

    My problem is solved.

    I solved the issue.using the main concepts of java.

    By importing a package into other package and then instantiate the required class.

    Kind regards

    2793235.

  • How can I move a file to another AI work/text in Illustrator 4.1? ART EXPORT and IMPORT ART and ART of the PLACE do not work.

    How can I move a file to another AI work/text in Illustrator 4.1?  Using the art of export, import or the art of the place don't give me image.  What transfers is a rectangular box with a big X in it.  Illustration of the song gives me only a distorted picture.

    If it really is version 4, it is 25 years old. I'm surprised you have install much less run. Then copy and paste does not work? These files generated in V4 or newer files? The really only files up to V8 may be opening in V4. After that, the format of file completely changed.

  • How to navigate from one page to another page.

    I'm trying my hands on Flex by building a sample application.

    After the user connects I want it to be on the home page. So in Flex how to navigate from one page to another on certain conditions?

    A way I thought is to make invisible visible n components, but which does not seem a good idea.

    What approach allows us to reach this goal?

    Please suggest.

    For your scenario, you really have to use the ViewStack (do not use States for this).

    Here is a link:

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=navigators_3.html

    And here is a very simple code:


    http://www.Adobe.com/2006/mxml">
     
     
       
         
       

       
         
       

       
         
       

       
         
       

     

    If this post answers your question or assistance, please mark it as such.

  • How to recover the one table to another table

    By querying the tables system how can I get the tables with a foreign key on a X column to a certain table Y? I mean I have a table TAB1 with a COL column and I want to know who all the table having a column COLLAR on which they have a foreign key to TAB1.
    I don't know how to properly use user_cons_columns and user_constraints and what else...
    Thank you!

    Try this

    Select the table table_name from user_constraints where R_CONSTRAINT_NAME in (select CONSTRAINT_NAME from user_constraints where TABLE_NAME = 'EMPLOYEE worker')

    Alexander gelin
    http://nimishgarg.blogspot.com/

  • How to migrate from one server to another (home of the workspace) html file

    Hello

    Does anyone know how to move an html file that is attached as a home page for the workspace from one server to another server?
    When I try to use the export option, I do not see this file to select.


    Thanks in advance,
    PM

    You can use the feature of LCM.

    THX

  • How can I move bright room to another computer

    How can I move bright room 2.2 to another computer XP system

    you are allowed 2 activations with your license.

    then, install on your new system and then activate.  If you do not want your previous room set up to count as one of your two activations in your old computer in a bright room, click Help > deactivate.

    If you can not activate on your new system because you get a warning that you have exceeded your authorized activations, disable on your old computer, and then try to activate on your new computer.

  • How do you burn one cd to another? Using windows xp.

    How to burn one cd to another...

    Hi amiot,.
     
    Here are some articles that you might find useful:
     
     
  • How to copy from one Application to another custom Page template

    Hello

    12.1.3 Jdev

    How can I copy a created exculpatory to one application to another?

    I don't want to create the existing application as a jar and add a library to the following. I want to copy an existing template and begin to change in the next request.

    See you soon

    AJ

    Each application that uses the model page, have the file called pagetemplate - metadata.xml, which is basically a repository of page template.

    When you create a page template, some entries are added to this file automatically for you.

    That's why I said lets you create a new model.

    Well, next to the source code of the template page, if the original model have pageDef, you need this pageDef too, so do the same - create Def page for your new template and just copy - paste the contents of the original.

  • Export data schema from one workspace to another

    Hi guys,.

    I run two workspaces with two separate schemas. One for the PROD and one as a DEV. I can easily export applications, and the objects of schema (DDL) a workspace to another, but is there a way I can migrate data (stored in arrays) of one schema to another using APEX?

    Otherwise, what is the best way to approach this situation? Thanks for watching it.


    APEX 4.1 running on Oracle 11g XE

    Hello

    Under SQL Workshop/utilities there are options for the creation and export/import DOF for objects, as well as the data in a text or XML. You could do what you need with these options, but it might get a bit tedious and would not particularly fast for large data migrations. In general, unless you have access to your data through the Apex, I would use a General as datapump or exp/imp database utility or even the copy of database SQL Developer utilities.

    Concerning
    André

  • How can I move a table in Dreamweaver CS4?

    Hello

    I create my home page in Dreamweaver CS4 and I made a table. I can't figure out how to move the table to the top of the page where I want. Any ideas on how to move a table?

    Thank you

    ashmic19

    Add this to your CSS:

    Body {margin: 0; padding: 0}

    And your table code should begin immediately after thetag in your HTML file.

    something here

    By the way, table-based layouts are NOT the best approach.  You would like to take this opportunity to learn to work with CSS layouts.  This is the standard modern web.

    Tables to CSS Web Design part 1-
    http://www.Adobe.com/devnet/Dreamweaver/articles/table_to_css_pt1.html

    Tables to CSS Web Design part 2-
    http://www.Adobe.com/devnet/Dreamweaver/articles/table_to_css_pt2.html

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

Maybe you are looking for

  • impression on my e mails Thr became very low

    the print is too small to read my emails, it wasn't like that before, when I access my E Mails by aol, the impression is very good, so I think it's a problem with my setting Firefox can you please help me?

  • C850-1 kN - troubled satellite factory reset

    The laptop came with Windows 8 and this improved to 8.1 last month. Last week, when I tried to start it says "Prepare the automatic repair" and showed white screen after that.I have read on the internet and pressed 0 with button / stop and chose Rese

  • TecraS1 TFT-resolution is lost after suspend

    Hello everyone, could someone help me?I use a laptop TecraS1 with Windows XP. I installed the drivers lasted from Toshiba Support.But there is a problem, when laptop is mode ensures the active state: often, the display resolution is lost and changed

  • Satellite A100-570: need Driver for ATI Xpress 200 M graphics card

    Hello Could someone tell me where I can find the driver for my advice on video ATI card in Vista Edition Home Premium - 32 bit? is the name of the device: RADEON XPRESS 200 M Series (Microsoft Corporation - WDDM)Hardware ID is:PCI\VEN_1002 & DEV_5A62

  • Executable form LabVIEW

    Hello   I am new to Labview.So, I have some doubts about labview. The major role of Labview in my current project is for GUI development.   1. How can I record the Labview graphical end-user interface?, I mean I'll save as exe file and run in a syste