Merge data from several rows in the output row

rollno

name
City
1--
-XYZ-
--Pune

Suppose that it is a table of student and I want to output such as,

rollno name of city

------------------------------------

1 xyz Pune

How can I get it pls tell me.

Hello

Here's one way:

SELECT MIN (rollno) AS rollno

MIN (name) AS the name

MIN (City) AS city

The STUDENT

;

This assumes that each column will have (at most) only 1 entry not NULL.

If my assumption is wrong, then after a few examples of data (CREATE TABLE and INSERT statements) and the results desired from these data.  Explain how you get these results from these data.

Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: https://forums.oracle.com/message/9362002

Tags: Database

Similar Questions

  • Import data from a spreadsheet on the web to the Numbers worksheet

    How can I import data from a spreadsheet on the net in a Numbers spreadsheet, keeping its original format? It is not a problem when you use Microsoft Excel or OpenOffice spreadsheet and had no problem when I was with Appleworks6. When I try in number, however, the data which is along a line on the original worksheet comes to the bottom of the left column, which is completely useless.

    copy the line then pasted in numbers (command C and V command) has always worked well.

    The line of values must be copied from a continuous row of cells.

    If you provide a link to a spreadsheet, I can test it on my machine.

  • Collect data from specific frequency of the power spectrum

    Hello

    I want to know how to collect data from specific frequency of power spectrum file. I'm trying to separate data from specific frequency of the original file.

    This will depend on much how your data is stored. You will need a way to read the file in LabVIEW and then a way to identify the data you want. I often record data in a .csv file, then I use "Reading worksheet" to get the data in a table. Then, you can simply use 'Index Array' to get the datapoints you need.

  • the analysis of data from a legacy in the form of bytes bluetooth

    Hi, Iam execution of java for MYGlucoHealth code monitor. I have to catch the bluetooth through my application data and analyze format. (later I store in the SQLite database). But according to the specification of the Protocol had, I do not understand how to read and analyze. I know how to pair the device to my request. But I do not know how to parse the bytes of data according to the Protocol of the device specification.

    Can someone tell me how to do this. All done with this kind of coding?

    Thnaks in advance,

    -Cissokho

    Published by: 798686 on November 2, 2010 02:38

    798686 wrote:
    Ok.. Thank you

    Tips for the facilitator: don't double post. I've locked the new thread.
    the analysis of data from a legacy in the form of bytes bluetooth
    Please continue here.

    DB

  • How to extract the data from each row

    Hello

    I wrote a CQL query with lines 3 records. Is it possible in this query to fetch the first record and last present specific field values.

    for example,.
    Column: c1, c2, c3
    Record1: id1, 2,3, 3.5
    Record2: id2, 2.3, 3.6
    record Record3: id21, 2.3, 3.7
    record Record3: id25, 2.3, 3.9

    I need to get the average of three rows of c3 and get the first record id and last record ID.

    Output 1: id1 id1, avg (c3) = 3.5
    output2: id1, id2, avg (c3) = 3.55
    Output3: id1, id21, avg (c3) = 3.6
    output4: id2, id25, avg (c3) = 3.733

    Please help on above.

    Thank you
    Sri

    Hello

    Not quite sure that understand what is the problem that you see.

    Here's what I got when I ran the query:

    Input data:

    C1, c2, c3
    ID1, 2,3, 3.5
    ID2, 2.3, 3.6
    id21, 2.3, 3.7
    ID25, 2.3, 3.9
    DELAYED26, 2.3, 4.0
    ID27, 2.3, 4.1

    Query:

    Select T.firstC1, T.lastC1, S1 T.avgC3
    () match_recognize
    measures
    First (M1. C1) as firstC1,
    M2. C1 as lastC1,
    AVG (C3) as avgC3
    all matches
    model (A B? C ? | D + C)
    subset m1 m2 = (A, B, C) =(A,D)
    define
    At as prev (A.c1) is null.
    B as (count (*) = 2),
    C as (count (*) = 3),
    D like ((prev (D.c1) is not null) and (count (*))<>
    ) t

    Output:

    firstc1, lastC1, avgC3
    ID1, id1, 3.5 - avg only trace
    ID1, id2, 3.55 - avg from two records
    ID1, id21, 3.6000001 - avg from three recent reviews
    Id2, id25, 3.7333336 - avg from three recent reviews
    id21, delayed26, 3.8666668 - avg from three recent reviews
    ID25, id27, 4.0 - average last three book reviews

    This output confirms with you that mentioned the expected results?
    Can you please run this query as it is on the above mentioned input data and check by yourself?
    If you don't get the desired result, please paste the input data provided, complete the text of the query and the outputs.

    Concerning

  • Comparison of the data of several rows in a table - based on the primary key

    Currently I have a select statement that returns hundreds of records.  Each returned record is linked to A NUMBER of ORDER this order number has a recipe.  (a bit like a cooking recipe).  Each recipe has many records in the database related to this order number and records should be compared to records in a table that bind to a specific primary key...  (I have already developed the logic to isolate what PK I need).  If all these records that are returned by the select statement below does not match all the records containing PK in the table below, I need to get the next PK and compare all these recordings for select statements return.

    See below for a better understanding. Need a good example detailed on how to solve my problem here.

    Just to help you understand:

    Each element of the recipe is 3 parts (side, ref_des, part_number).  1 single recipe can have several parts (where the part_number), and each of these pieces should be placed on the lower side or top of the Board that is there "side" comes into play.  Same thing with Ref_Des.

    What is going on

    Select statement returns the RECIPE of ORDER NUMBER A.  There will be multiple records returned by this query.

    Select the Return statement:

    • Side
    • Ref_Des
    • Part_Number

    Example of return:

    B c17 75145-2

    T f14 89242-8

    B s12 45123-3

    etc,

    In general - what I need to do:

    There is a table called AUTO_RECIPE_DETAILS.  I take all of the records returned by the select query above and compare for each record in this table relating to the recipe 30319-000001.  30319-000001 a number of records.  It is the primary key for a whole recipe as seen above.  This primary key is bound the number of data records in this table.  The comparison is to see if all records under RECIPE_NAME 30319 -000001 match all the records returned by the select statement.

    IF IT DOES NOT MATCH: recover the following recipe in this table below 30319 -000002 and make the same comparison.

    Here's a perfect example of what the table looks like: (AUTO_RECIPE_DETAILS)


    RECIPE_NAME SIDE REF_DES PART_NUM

    -30319-000001 C16 87595-1 B

    -30319-000002           T B14 74150-4

    -30319-000001 T B14 34251-2          

    -30319-000001            T F24 84180-7

    -30319-000002 T B12 13710-8          



    It is the solution to my original question.  By this thread, it's the right answer and I hope this helps someone who is trying to compare two arrays element-by-element.  In the end, the advice given in this thread were correct and I will be using all of your suggestions and the scrapping of this.  Thank you everyone for your help though.

    FOR index_p IN pid_recipe. FIRST... pid_recipe. LAST

    LOOP

    Result WHEN the OUTPUT = 1;

    FOR index_d IN details_recipe. FIRST... details_recipe. LAST

    LOOP

    IF (pid_recipe (index_p). SIDE = details_recipe (index_d). SIDE)

    AND (pid_recipe (index_p). REF_DES = details_recipe (index_d). REF_DES)

    AND (pid_recipe (index_p). PART_NUM = details_recipe (index_d). PART_NUM)

    THEN

    EXIT;

    ON THE OTHER

    DBMS_OUTPUT. Put_line("IT WAS NOT a MATCH");

    result: = 1;

    EXIT;

    END IF;

    END LOOP;

    END LOOP;

    DBMS_OUTPUT. Put_line('LOOP OUT');

  • Copy the data from two rows together in a new line

    Hello everyone.

    I have a question for copying data from two lines together in a new third line.

    See this short example:

    This is the current situation. The lines STATE_1 and STATE_2 contain different information separate.

    In the past data were recorded at random in one of these lines.

    It's the state table:

    ID Cust_id STATE_1 STATE_2 STATE_3
    188Customer is waiting.Call since yesterday.
    211Mr. Smith, no answer.Wait until December
    311Pls Create PO.Old PO has been cancelled
    45No access to the system.

    Now, everything must be recorded in the STATE_3 void, but I also need than the old entries from the past which must also be copied together in STATE_3

    Like this:

    ID Cust_id STATE_1 STATE_2 STATE_3
    188Customer is waiting.Call since yesterday.Customer is waiting. Call since yesterday
    211Mr. Smith, no answer.Wait until December.Mr. Smith, no answer. Wait until December.
    311Pls Create PO.Old PO has been cancelled.Pls create in. old PO was canceled.
    45No access to the system.No access to the system.

    Y at - it an SQL-easy order?

    Thanks for any help.


    What:

    update set state_3 = state_1 State | » '|| state_2;

    ?

  • Remove data from several tables

    I want to delete the data of all tables in this database which having device_id = "A1".
    How to do it. 2 questions heres
    (1) there are about 40 tables of the database and do not know what table contained the device_id field.
    (2) we have several such deviced_id should be deleted, for example device_id = 'A1', or device _id = "A2", "A3". can sql read this info from a table and the process?  Thank you

    Look at this example

    SQL> create table t1 (device_id varchar2(2));
    
    Table created.
    
    SQL> create table t3 (device_id varchar2(2));
    
    Table created.
    
    SQL> insert into t1 values('A1');
    
    1 row created.
    
    SQL> insert into t1 values('A');
    
    1 row created.
    
    SQL> insert into t3 values('A1');
    
    1 row created.
    
    SQL> insert into t3 values('B');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from t1;
    
    DE
    --
    A1
    A
    
    SQL> select * from t3;
    
    DE
    --
    A1
    B
    
    SQL> select table_name from all_tab_columns where column_name='DEVICE_ID';
    
    TABLE_NAME
    ------------------------------
    T1
    T3
    
    SQL> DECLARE
      2     CURSOR my_cur
      3     IS
      4        SELECT table_name
      5          FROM all_tab_columns
      6         WHERE column_name = 'DEVICE_ID';
      7  BEGIN
      8  FOR MY_REC IN MY_CUR LOOP
      9      --DBMS_OUTPUT.PUT_LINE('delete from '||my_rec.table_name||' where device_id=''A1''');
     10      EXECUTE IMMEDIATE 'DELETE FROM '||my_rec.table_name||' WHERE device_id=''A1''';
     11  END LOOP;
     12
     13  END;
     14  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from t1;
    
    DE
    --
    A
    
    SQL> select * from t3;
    
    DE
    --
    B
    
    SQL>
    

    - - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev a. (10g OCP)
    http://kamranagayev.WordPress.com

  • Collect and display data from several workstations

    Currently, the data in the CSV format locally on several workstations running Labview and the format of the recorded data is the same for each workstation. Data are recorded roughly every 2 minutes at each station and at different times.

    Computers of these stations are connected network but no saves a copy of their files CSV to the server that I know is not ideal, but a part of memory original.  What is now there that a computer on the network brings together these data by workstations and then the poster showing trends in workstations etc. in graphic format and possibly Excel.

    What I'm looking for is some advice on the best way forward.

    I looked at shared variables as a possible solution, but it is work stations send their respective data to the 'central' PC or this PC "questions" workstations that seems inefficient.

    Another thought was using Active X workstations to write in an Excel file running on the "central" PC

    Finally thought that workstations have record their findings to a server and then 'central' PC to access that data, it brings together and then displays the results combined.

    There are several things that remains to be clarified.

    • All LabVIEW programs, individual data record data in the same format and the same number of data points?
    • Record all programs of LabVIEW at exactly the samerate?
    • Are all data on a be saved in a single file of the Machine, or each reading (at intervals of 2 minutes) in a separate file?
    • You are trying to combine data from different machines such that it is collected or after the entire collection was done, and all files have been written?
    • Another that the timestamp of the data file, is there a "time stamp" in (all) the individual data files?
    • If you assume that the data of different machines are more synchronized, you have in mind a way to combine the different readings of the time?  What happens if they are sufficiently different that, say, the Machine has 20 readings more (because it started much earlier) than other PCs?
    • If the machines are not saving at the same rate, how will handle you that?

    A single method, you might consider is to write a program that works on any network connected PC, including a no participate in the recording of data.  For simplicity, assume that each machine "participatant" starts at around the same time, saves exactly at the same rate, written a single data file and has already closed.  If the program "Combining" knows where all data files (because he knows the name of each machine and the location of the file on each machine), it can open all the files, collect all the data and treat it but want to (including a 'combined Excel workbook"writing with a spreadsheet separate for each PC, or combining them all on one sheet).  Just decide what you want to do in the context of the issues raised above.

    Bob Schor

  • Tracing data from two locations on the block diagram on the same graph

    Hello world

    I'm trying to plot data from two distinct processes on a chart.  These processes occur in the order.

    I have developed several solutions, which none produce the result I want.  What I want is for the data to trace in real time each process is running.

    The two processes are functionally identical - one loop "for".  With each iteration of these loops, data is produced and traced.

    The data are plotted in real time, which means that each reference appears on the chart as soon as it is produced.

    However, I am not able to get the second process data on the same graph in the same way.

    The closest I got combines the graphic with a local variable.  This allows the data for the two processes to draw in real time, but the second set of data replaces the first.

    I have attached a very simple test VI showing my problem.

    Any help with this would be greatly appreciated.

    Thank you

    You can do something like this. Is the second process just a continuation of the first? If so, it becomes even easier and you can just to keep construction of the table in the second loop.

  • Composite planning form, copy data from one tab to the other?

    This is something I've heard of someone who did but have not actually seen. The requirement is to copy data from an existing entity to a new entity as a means of values seedlings early in the budget cycle. I was thinking about a form of 'source' and a form of 'target' within a composite shape. A calc would make a copy. After copying the Scheduler can manually adjust values, or type values in the accounts that the source had no data.

    If someone did please let me know how you did and what looked like the calc.

    Thank you!

    FA

    Hello

    Yes, this can be done in several ways. The calc script would be similar to what is mentioned above. But in regards to the copy, you can also create a menu on the source form set a rule of company on the menu and start the copy that also offer users the ability to choose several invited outside of the entity if necessary.

    Thank you

  • Which service API should I use to retrieve data from Eloqua 'Integration of the internal queue'?

    In my Eloqua Sandbox environment, I managed to create several "external Test calls complete" that appear on the tab 'Reports of the integration of queue internally'. Can someone tell me what Eloqua API or services are required to recover the data of this "Internal queue" Eloqua? I guess that's the way to connect the dots of data updates occurring in Eloqua to an external system. My ultimate goal is personalized with a non-native CRM integration.

    Thank you

    Heath

    Hi Heath,

    The post following (How to recover data from activity through the API) describes how to extract data from the queue inside.

    Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • Hyperion Financial Reporting: Recover data from several lines of another grid

    Hey geniuses,.

    Don't know if this is the right place to ask questions on HFR...

    I have two grids: welcome and support. I tried to recover data supporting the grid, where there are 10 children report derived from a line of HFR lines. I intended to show all children of 10 lines in the report. I tried ".row grid [X] [X]" to recover data and < < MemberName > > to retrieve the name of the project, but only one line is presented in the main with the first name of line project (grid support) and report data sum of the total 10 rows (grid support).

    All good ideas?

    Thanks to a bouquet.

    Instead of the formula line insert a line of text and add the function

    >
    >
    >
    .....................................................

    The problem should be solved

    Concerning

    Celvin

    http://www.orahyplabs.com

  • How to load data from matrix report in the base using ODI table data

    Hello

    How to load matrix report data in the base table data using oracle Data Integrator?

    Description of the requirement:

    This is the data from matrix report:
    JOB                       DEPT10                DEPT20  
    ___________________________ _____________
    ANALYST                                           6000
    CLERK                   1300                     1900 
    Need to convert it to the format below:
    JOB                             Dept                        Salary
    _____________________________________________
    ANALYST                  DEPT10      
    ANALYST                  DEPT20                     6000
    CLERK                       DEPT10                    1300
    CLERK                       DEPT20                    1900
        
    Thank you for your help in advance. Let me know if any other explanation is needed.

    Your list seems to be a bit restrictive, you can do much more with the procedures of ODI.

    If you create the new procedure and add a step. In the 'source' tab command you define technology and pattern according to your source database. Use the unpivot operator as described in the link, please, instead of using "SELECT *' use the column names and aliases for example:"

    SELECT workstation,
    deptsal as deptsal,
    saldesc as saledesc
    OF pivoted_data
    UNPIVOT)
    deptsal-<-->
    FOR saldesc-<-->
    IN (d10_sal, d20_sal, d30_sal, d40_sal).<-->
    )

    Then in your tab 'command on target' defined technology and drawing on your target db, then put your INSERT statement for example:

    INSERT INTO job_sales
    (employment,
    deptsal,
    saledesc
    )
    VALUES
    (
    : job,.
    : deptsal,.
    : saledesc
    )

    That's why you use bind variables from source to load data into the target.

    Obviously if the source and target table is in the same database, you can have it all in a single statement to the "command on target' as

    INSERT INTO job_sales
    (employment,
    deptsal,
    saledesc
    )
    SELECT workstation,
    deptsal as deptsal,
    saldesc as saledesc
    OF pivoted_data
    UNPIVOT)
    deptsal-<-->
    FOR saldesc-<-->
    IN (d10_sal, d20_sal, d30_sal, d40_sal).<-->
    )

    also assign the log count "Insert" on the tab corresponding to your INSERT statement, so that you know how many rows you insert into the table.

    I hope this helps.

    BUT remember that this feature is out in Oracle 11 g.

  • Collection of data from several forms

    Hello

    I am building an application, where to get the data from different forms on different pages.

    I use hidden fields to send the value from one page to another. This method works for a transfer to top, but when I use hidden fields to transfer data from the 2nd to the 3rd page, I lose the data for the 1st page.

    I tried using the query as string:

    < form method = "post" action = "ww" = name "kk.cfm? option = 1 & name = username # & entry = #id #" >

    Its not working for several page data transer, just for the transfer of data from single page.

    I just do it? Please help these rookie.

    Thank you

    Vijayvijay77.

    firstForm.cfm:


       
       
           
           
       
       
            
           
       
       
           
       
    ID of the user:
    Name:

    secondForm.cfm:


       
           
           
       
       
           
           
       
    ID of the user:#FORM.userID #.
    User name:#FORM.userName #.







       


           
       


    thirdForm.cfm


       
           
           
       
       
           
           
       
    ID of the user:#FORM.newUserID #.
    User name:#FORM.newUserName #.

    Please have a try with the above stuffs. Please copy and paste your code here if you still encounter a problem here.

    FYI - please make sure that you correctly use cfoutput tag.

Maybe you are looking for

  • make a block diagram: sequential table worth staying

    Hello I'm doing a block diagram for sequential same length of sequential inputs outputs. It seems easy to do before I was in fact table of wiring, but I stuck. So what I want to do is the following. For example, a sequential input value will in say'u

  • How to use time with the State in MODE Lab machine

    Hello I tried to use the state machine with function elapsed time so sequentially, start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I have attached the code, the problem is when I place the function e

  • the webcam updates

    I am currently using windows XP Home Edition and have recently bought a lifecam5000.  I am unable to connect to the updates of the firmware or software for that.  I registered the product online. Help, please?

  • Command prompt flashes on and never time.

    Hi all Need help. I get a window 'Command Prompt' flashing on and outside at the same time every hour. I managed to make a screenshot of it and it says the following "BITSADMIN version 3.0 [7.5.7601]. BITS administration utility. Copyright 2000 - 200

  • Why can't play movies blu - ray if a blu - ray player driver?

    I just get a laptop with blu - ray driver, but I can't play a blu - ray movie