How to display several column data in an Oracle SQL column

Hello

I have the table t1 and (a1, a2, a3) are columns

I have this request

Select the t1 a1
Union
Select a2 from t1
Union
Select a2 from t1

This is the variant is unpivot, but he calls internal table several times.

I wish in a way, where I want the same output, but the appeal of the table only once.

Thank you
Sunil Jena

Published by: 990324 on March 15, 2013 04:46

Assuming a1, a2 and a3 have the same data type:

select  case lvl
          when 1 then a1
          when 2 then a2
          else a3
        end
  from  t1,
        (
         select  level lvl
           from  dual
           connect by level <= 3
        )
/

SY.

Tags: Database

Similar Questions

  • FCP 7 How to display several takes both

    I'm running FCP 7 on a Macbook Pro with OS 10.10. Trying to figure out how to display several takes of the video on my calendar running at the same time. Mounting a show of live music from four cameras simultaneously turned and want to choose between shots while seeing the four outlets. Is this possible?

    Multiclip editing:

    https://documentation.Apple.com/en/FinalCutPro/UserManual/index.html#chapter=42% 26section = 12% 26tasks = true

    MtD

  • BI Layout Editor - how to display the current date?

    Hello

    Recently used BI Layout Editor (previously using MS Word to create the presentation of the State).

    He seems really nice and easy to use.

    However quick Q - How to display the current date in the layout editor (to show the report run date).

    Any quick suggestions is appreciated.

    Thank you

    Vivek

    Tab displays your selection available.

    It's like how when you insert the table in the Word document and when you select the table, you would see 2 additional tabs such as the design and the tool.

    Can you please insert "Text Element" and select the text element and see if you go to the tab 'text '?

  • Compare and display several column data according to requirement

    Hello

    I have a requirement where I want to compare the data in two tables and display only the columns if there is a gap using the sql query.

    Tell userid, e-mail and phone number of the same employee is stored in two tables. Now, I want to compare data from e-mail and phone number of the two tables and display the e-mail and phone number as if they are different data.

    Employee table:

    user_id E-mail phone
    emp01[email protected]00200
    emp02[email protected]

    00300

    emp03[email protected]00400

    Table user_details:


    ID user_email user_phone
    emp01[email protected]00201
    emp02(null)00300
    emp03[email protected]00401


    Please note that both tables have completely different column names and the data may contain a null as well. What I want to achieve is to compare the same employee data in both tables and display columns that have a different value of user_details table; as:


    user_id user_email phone
    emp01[email protected]00201
    emp02(null)
    emp03[email protected]00401


    As the table column names are different, I can't use a join and less to know the difference. I tried this with the help of CASES after the WHERE clause for comparison of columns multiple but GOLD or AND the two would defy the condition to display all columns with different data for the same line.


    How to do this without creating a separate view or a table that I don't have write access? Pointers would be useful.


    -Thank you.


    No need for something like

    You just run

    Select k.user_id, k.id,.

    e.email, u.user_email,

    e.Phone, u.user_phone

    of user_key_table k

    left outer join

    e employee

    On k.user_id = e.user_id

    left outer join

    user_details u

    on k.user_id = u.id


    the rest is here just to simulate your tables (I don't want to create tables in my APEX Tablespace as there are far too many people already)

    Concerning

    Etbin

  • How to load several columns of data into Essbase

    Hello!

    I need to download a flat in Essbase data file, but this file contains data for each month in a separate column (Jan, Feb and March), it has several columns of data in the source file, while the DATA reversed Essbase data store is a fact with a column of the data table. So I'm stuck on the way in this case to map more than one column of data in the source file to column 1 of the target data.

    Thank you very much!

    When yo reversed your essbase data model in the RKM there will be an option called SEVERAL COLUMNS of DATA (no default value), this must be set to yes. Then, there are 2 other options that need to be addressed DATA_COLUMN_DIMENSION which is the name of the dimension that you load multiple values to in your case period. Then in the next option DATA_COLUMN_MEMBERS specify you a comma list of members separated... column data required i.e. Jan, Feb, Mar etc. Now when you reverse the model, you will have several column data members

  • How to display a given date in a DateField?

    Hi Experts,

    I'm developing an app for BlackBerry in Java. I want to display a date I will give statically for example "October 4, 2008. I did, but while reading, it is displayed in January 1, 1970. How can I display a static date in a DateField?

    Thank you and best regards,

    Nithya

    Simple use.

    import java.util.Date;

    Net.rim.device.api.i18n import. *;

    String date = new SimpleDateFormat("dd/MM/yyyy_hh:mm").format (new Date (System.currentTimeMillis ()));
    Add (new RichTextField (date));

  • How to display the current date in a textfield?

    Hi all

    I have a textfield, and it is a part of the P18_DOJ page. By defalut that I want to display today's date to the textfield and it is should be readonly. How do I do that?

    Put "Select sysdate from dual;" as the source SQL Query type and "readonly" in the field of the HTML Form element attributes.

  • How do delet several columns in the 2D table 0

    Dear Sir.

    Please tell me how delet 0 multiple column besuace zero of one by a column of delet take too much time. Here, I have attached the program with this message and the main file.

    Julian_prince wrote:

    Please tell me how delet 0 multiple column besuace zero of one by a column of delet take too much time. Here, I have attached the program with this message and the main file.

    How big are your real matrices? How do you measure the speed? How fast is now and how fast should it be?

    In all cases, you can do it with a single loop, for example as an attachment.

  • How to display the current date in a project CP5?

    What is the best way to display the current date in captivate?

    Hello

    Use a text caption in which you insert the system variable cpInfoCurrentDate.

    Insert a variable is possible with the X in the Format of the text caption properties panel accordion:

  • How to display the current date in a Flex application

    I need to display the current date in my Flex application.  Is there a simple way to do this and post it as a text field or label?  In addition, it can be formatted to display the date as "day of the week, month, day, year"?

    Thank you!

    You can use this page and copy the following code to change the formatString property.

    http://livedocs.Adobe.com/Flex/3/langref/MX/formatters/DateFormatter.html#FormatString

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

    
    http://www.adobe.com/2006/mxml"
      creationComplete="init();">
      
        
      
      
      
    
    
  • How do I know the date when an oracle database is improved

    Hello

    I would like to know the date when an oracle database is upgraded (for example 10.2.0.4 to 11.2.0.3).

    Can you help me find these details.

    Thank you

    Delphine

    To be more precise, you can query

    Select to_char (ACTION_TIME,'MON-DD-YYYY ""), the SUBMISSIONS in ACTION, ID, VERSION, BUNDLE_SERIES, of DBA_REGISTRY_HISTORY where ACTION = 'upgrade ';

    Example:

    SQL > select to_char (ACTION_TIME,'MON-DD-YYYY ""), the SUBMISSIONS in ACTION, ID, VERSION, BUNDLE_SERIES, of DBA_REGISTRY_HISTORY where action = 'upgrade ';

    TO_CHAR (BILL ACTION VERSION ID BUNDLE_SERIES COMMENTS

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

    6 March, 2009 UPDATED 10.2.0.4.0 improved 10.2.0.3.0

  • How to display rows of data in different columns?

    I'm new to SQL and currently, that's what I try to do:

    Display multiple lines of data in different columns in the same row

    I have a table like this:

    CREATE TABLE TRIPLEG)

    T # NUMBER (10) NOT NULL,

    STEP # NUMBER (2) NOT NULL,

    DEPARTURE VARCHAR (30) NOT NULL,

    VARCHAR (30) DESTINATION NOT NULL,.

    CONSTRAINT TRIPLEG_PKEY PRIMARY KEY (T #, LEG #).

    TRIPLEG_UNIQUE UNIQUE CONSTRAINT (T #, DEPARTURE, DESTINATION).

    CONSTRAINT TRIPLEG_FKEY1 FOREIGN KEY (T #) REFERENCES TRIP(T#));

    INSERT INTO TRIPLEG VALUES (1, 1, 'Sydney', 'Melbourne');

    INSERT INTO TRIPLEG VALUES (1, 2, 'Melbourne', 'Adélaïde');

    The result should be something like this:

    > T # | ORIGIN | DESTINATION1 |  DESTINATION2

    > 1 | SYDNEY | MELBORUNE | ADELAIDE

    The request must include the ' COUNT(T#) < 3' since I only need to display the records of less than 3. How can I get the results I want to use relational views?

    Thank you!!!

    I replaced the syntax "where" with the syntax 'account '. The reason why I do this is because I want to only display records with a number of travel of less than 3. By defining where the legs #.<=3, the="" result="" will="" be="" all="" the="" records="" of="" the="" tripleg="" table="" since="" each="" record="" could="" also="" have="" leg#="" is="">

    The answer is:

    with t as (SELECT t #,)

    REGEXP_REPLACE)

    LISTAGG (start |) '->' || destination, ' ')

    THE Group (ORDER BY t #, leg #).

    '([^ ]+) \1+',

    "\1") str

    OF tripleg

    HAVING COUNT (T #)<>

    GROUP BY t #)

    Select T #, regexp_substr (str, ' [^->] +', 1, 1) departure

    , regexp_substr (str, ' [^->] +', 1, 2) destination_1

    , regexp_substr (str, ' [^->] +' 1, 3) destination_2

    , regexp_substr (str, ' [^->] +' 1, 4) destination_3

    Thanks to Marty and knani!

  • How to display all the data using several parameters?

    Hi all
    I used a query as follows to display the data in a report:

    Select col1, col2 / / col1 and col2 are columns of tabale tab1
    of tab1
    where
    tab1.Col1 =
    (case when: P_COL1 IS NOT NULL then / /: P_COL1 IS a USER SETTING to EQUAL COL1)
    : ANOTHER P_COL1 tab1.col1
    end)

    AND TAB1. COL3 =
    (case when: P_COL3 IS NOT NULL then / /: P_COL3 IS a USER SETTING to EQUAL COL3)
    : ANOTHER P_COL3 tab1.col3
    end)

    The problem is when I run the report with the values of parameters or not, it shows the data that is not null for col1 and col3.
    That is when the value of col1 or col3 is zero the report would not return this record!
    I want the report to show all the data not just the values that is not null.
    How to do this?

    Men,

    ( :p_col1 is null or ( :p_col1 = tab1.col1 ) )
    and
    ( :p_col2 is null or ( :p_col2 = tab1.col2 ) )
    and
    ( :p_col3 is null or ( :p_col3 = tab1.col3 ) )
    
    etc.
    

    Kurz

  • How to display several numbers in a single column in same PO?

    How can I display multiple receipt of a single purchase order numbers in the same area?

    Check this box...

    Select pha.segment1 po_num

    , rtrim (xmlagg (xmlelement (e, rsh.receipt_num |))) ') .extract ('/ / text()'), ',') enames

    of rcv_shipment_headers rsh

    rcv_shipment_lines rsl

    po_headers_all pha

    where rsh.shipment_header_id = rsl.shipment_header_id

    and rsh.creation_date between (sysdate-20) and (sysdate)

    and rsl.po_header_id = pha.po_header_id

    Pha.segment1 group

  • How to display the exact DATE of my first access to a Web site?

    I need to see when I first consulted several Internet sites. History does not show it, but maybe I'm missing something.
    I appreciate all help.

    ~ airix

    In history, Firefox only displays the most recent visit to a given URL. To find previous visits, you need a tool that allows you to view old data in the database places.sqlite. These discussions have discussion of a few options:

Maybe you are looking for

  • radial wipe

    Is it possible to make a radial wipe in Motion 5? In other words, a circle "wiping" of anything in a full disk, filled, downtown? Thanks in advance.

  • Re: A110-231 - what is the largest HDD compatible player?

    Hello. I want to change the hard drive with others larger. I need to know what is the biggest hard drive I can install it. Can I install a SATA II or SATA III disc?. Thanks in advance. F.F.: Sorry my poor English.

  • After removing the Real Player, I can more open shortcuts to office.

    Original title: How can I fix problem with shortcut Wednesday, June 28, 11, I used IOBOT advanced system care 4 uninstall (uninstalling advanced deep) utility to remove real player.  I didn't know that he loose Windows Media Player 11.  WPM 11 has al

  • XP Reinstall after the failure of HD

    The hard drive of my main computer failed last week.  I have a new hard here in car and ready to install.  Once I have and am ready to install Windows still once, can I use the same certificate of authenticity, or I'll have to buy a new license to in

  • Error: "" Windows Media Player has encountered a problem reading the file' when try to play a music video.

    Original title: "Windows has encountered a problem during playback of the message to the file. No one knows why, I received this message trying to read a music clip of Mediabase on my computer which already includes Windows Media Player 11 as part of