Add two columns and by displaying as a single column

Hello

I am trying to add (concatenate) two results of sql statement and want to show them as a single result column.

Example of...

Select ename from emp;

Select dname dept;

now, I have to add (concatenate) these two query results and show them as a result of a column...

Suggestions please...

Thank you and best regards,

Praveen

Select ename | DNAME as a' department' from emp, dept

Tags: Database

Similar Questions

  • How to add two columns in the criteria (OBIEE 11 g)

    Hello

    I try to add two columns in a criterion of obiee

    * "Done - OLB processed invoices. "" Invoice amount - currency "__" made - OLB processed invoices "." " The amount of taxes AR - billing currency"

    but the problem is:-
    The first column have 500000000 and the second column contains some NULL values from the table. I think that this could be the problem when I try to add that it gives no output.
    just an empty box.

    Can someone tell me how we can add columns in this State.

    Thank you to each and every one.

    Try IFNULL (expr, value)
    for the other columns

    "Done - OLB processed invoices". " Charge the amount - currency "+ IFNULL (" made - OLB processed invoices "". ")" AR tax - currency billing", 0)

    Published by: Srini VIEREN on March 20, 2013 10:02

  • Left join of the two tables and multiple values into a single value separated by commas

    Hello

    I have following tables with their structures and their data as below.

    CREATE TABLE 'BETODI '. "" BETINFO ".

    (

    VARCHAR2 (8 BYTE) "CURRENTPRESS."

    ENABLE 'TYPEIDCONTAINER' VARCHAR2 (30 BYTE) NOT NULL

    )

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A24G', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A24D', 'Pensky-MARTENS');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ("A25D", "CMP");

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A25G', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A26D', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A26G', 'PMC');

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ("A32G", "V-BFC3");

    INSERT INTO Betinfo (Currentpress, typeidcontainer) VALUES ('A32D', "V-BFC2");

    CREATE TABLE 'BETODI '. "" BETMASTER ".

    (

    ACTIVATE THE "CUREPRESS" TANK (5 BYTES) NOT NULL,

    ACTIVATE THE "TYPE" VARCHAR2 (5 BYTE) NOT NULL,

    NUMBER (5.0) "LASTPCIRIM".

    )

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A24', '45 M 8', 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A25', 42 16', 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A26", 16' 45, 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A27", '45 M 34', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A28', '45 M 34', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A29', '45 M 34', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A30', '45MCH', 15);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A31", "45MCH", 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A32', '45MCH', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ('A33', '45MCH', 16);

    INSERT INTO BetMaster (Curepress, type, lastpcirim) VALUES ("A34", "45MCH", 16);

    These two tables have left join as

    BETMASTER. CUREPRESS = substr (BETINFO. CURRENTPRESS, 1, 3)

    now I want to have the data in the two tables with fields Curepress, Lastpcirim, typeidcontainer.

    Also something like

    Make a group of typeidcontainer if this value is greater than 1 by press separated the values of semicolon (;)

    So, for example above, we should be given as

    A24 PMC 15; PENSKY-MARTENS

    A25 15 PMC

    A26 15 PMC

    A27 16 (NULL)

    A28 16 (NULL)

    A30 15 (NULL)

    A31 16 (NULL)

    A32 16 BFC2-V; V BFC3

    A33 16 (NULL)

    A34 16 (NULL)

    How could do?

    My current request is as

    Select distinct Curepress, lastpcirim, typeidcontainer

    BETMASTER STD left join INF BETINFO

    on the trim (STD. CUREPRESS) = substr (trim (INF. CURRENTPRESS), 1, 3)

    but I am unable to get the values separated by commas.

    Any help would be appreciated.

    Thank you

    Mahesh.

    Hi, Mahesh,

    If you want to only 1 row of output for each distinct combination of currentpress and lastpcirim?  This sounds like a job for GROUP BY.

    And you want the row to contain a list of all different typidcontainers-delimited?  This sounds like a job for the aggregate LISTAGG function.

    WITH joined_data AS

    (

    SELECT DISTINCT

    MST.curepress, mst.lastpcirim, inf.typeidcontainer

    OF betmaster STD

    LEFT JOIN betinfo ON TRIM (mst.curepress) inf = SUBSTR (TRIM (inf.currentpress)

    1

    3

    )

    )

    SELECT curepress, lastpcirim

    LISTAGG (typeidcontainer, ',')

    THE Group (ORDER BY typeidcontainer) AS container_list

    OF joined_data

    Curepress GROUP, lastpcirim

    ;

    Unfortunately, you can't say LISTAGG (DISTINCT ...), so you should always get the separate containers how you already are.  (Note that the subquery is just what you posted).

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.  Don't forget to tell what version of Oracle you are using.  LISTAGG was new in Oracle 11.2.

    Why not add CHECK constraints (and perhaps triggers) to your tables, so that curepress and currentpress are not stored with the head or trailing spaces?  Then you wouldn't need to use the PAD in queries like this, and your code would be simpler and more effective.

  • Formula: Add two fields and divide a

    Help!


    I'm figuring a field that requires information of 2 other fields. I need of field "STR_2" to calculate the sum of the 'STR_1' field and 1/2 of the field 'Level' (rounded down). I use the following formula in the field "Calculate Custom script":

    {If (this.getField("Level").value! == {this.getField("Level").defaultValue)}

    Event.Value = (Math.round ((this.getField("Level").value - 1) / 2) + (this.getField ("STR_1")));

    }

    else {}

    Event.target.defaultValue = Event.Value;

    }

    However, it keeps returning the value "0 [ObjectField]" when the value of the 'level' is 1 and 'STR_1' 2 (it should return a value of '2').

    When I use the following formula:

    {If (this.getField("Level").value! == {this.getField("Level").defaultValue)}

    Event.Value = (Math.round ((this.getField("Level").value - 1) / 2));

    }

    else {}

    Event.target.defaultValue = Event.Value;

    }

    It works very well, and I get a value of '0' (1/2 "Level" rounded down). So, how can I fix this so that I get the right calculation?

    Thanks in advance!

    (If that makes a difference, I use Acrobat Pro XI on a Windows 7 laptop).

    You should correct this line in your first script for:

    Event.Value = Math.round ((this.getField("Level").value - 1) / 2) + + this.getField ("STR_1") .value;

    But this calculation does not do what you say you want. It subtracts 1 to the value of the field level and divides the result in two and adds the value of STR_1, which is different from what you have described.

  • How to add two fields and show the result in a third

    All,
    I have 2 InputText field; both are related to the fields of the associated database.

    I want to display the sum of these two fields on a text output.

    I declare the value of the output in this way text link:
    #{sessionScope.PersonalNrBean.summeDB.value + sessionScope.PersonalNrBean.kmGeldMlp.value}

    But I get this error:
    Cannot find resource for bundle java.util.PropertyResourceBundle, key el.convert

    ADF_FACES - 60097:Weitere desKomitees find DEM Fehlerlog einen entry as servers, der mit: ADF_FACES - 60096:Server - Exception while PPR, beginnt #3

    If I declare the value binding to contain the field even two times:
    #{sessionScope.PersonalNrBean.summeDB.value + sessionScope.PersonalNrBean.summeDB.value}
    It works as expected, but it's not really what I need...

    Any ideas?

    Thanks in advance,
    Sergio.

    Edited by: user5414451 the 14.07.2011 02:57

    Try following:

    #{bindings.summeDB.inputValue.value + bindings.kmGeldMlp.inputValue.value}
    

    Jean Lou

  • Need to display more than two columns in the game now (library view)

    The current reading list (under the library, not the instant game tab menu tab a top of the player) shows only two columns, the title and duration.  I can't add more columns by selecting choose columns, or restore the columns.  I have this problem with one of the entries in the left column of the display of the library (like, songs, recently added, etc.).  Is there a way can I fix?

    It's machine running a version of Windows XP on the computer and WMP11.  I had Windows XP and media player 11 on my laptop for several years and have had this problem.  I don't know what is different between the two machines that causes this problem.

    Yes, it seems to be more at hand than just differences in operating system. However, I think I found a way to get more columns in the game now:

    1 restart WMP, start to play music and go to playback.

    2. click on the heading of column Title to sort by title.

    3. switch to another view (for example songs ) and go back to playing now. You should already see the additional columns now.

    4. to make the columns 'stick' between reboots WMP, you also needed to right click on the column header in the current playback, select Choose columns , uncheck automatically hide columns and click OK .

    Tim Baets
    http://www.BM-productions.TK

  • calculate the sum of the two columns - display the result in the third column

    Hello

    I have a report and I want to calculate the sum of the two columns of the report and display the total in the third column.

    For example: Sample_My_Report

    Col1 Col2 (Col1 and Col2) Total

    3-7-10


    can someone help me with this question.

    Thank you.

    Hello:

    If your report is an IR you can use the menu "Tool" to add columns calculated at the State

    CITY

  • Pavilion Beats special edition: is it possible to add two monitors to my laptop specific and if so, how?

    Hello. I have a laptop 15-p058na with 1 x HDMI, 1 x USB 2 and 2 x USB 3. Ideally, I want to be able to add two screens to display separate sites or other applications, but I don't know if this model which will support or if I can just add a monitor.  I would be grateful for any advice. Graphics card is the AMD Radeon HD8510G graphics card if that helps. Thank you very much

    Well there is only one monitor on the laptop, the HDMI port but we USB 3.0 to HDMI adapters that work quite well and will allow another monitor to add.

    https://www.Amazon.com/STARTech-external-monitor-adapter-USB32HDES/DP/B00H91BQ7Y/ref=sr_1_1?ie=UTF8&QID=1478001840&SR=8-1-spons&keywords=USB+3.0+to+HDMI&PSC=1

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

  • Is there a way to divide such ads and Add ons in a screen and automatically display search results in the other

    Original title: twomonitorsononepc

    I have two monitors on my pc is there any way for example divide ads and Add ons in a screen and automatically display search results in the other.

    or if facebook were used cat into one screen and status on the other screen please

    Hi Richard,

    What is the operating system installed on the computer?

    It seems that you need to divide the same application in several windows and place them in different monitors. Is this correct?

    Unfortunately, it is normal and you can not split the same application on two different monitors.

    Hope this information helps. Get back to us if you have more queries about Windows.

  • Can break us af:table in two columns as panelformlayout display?

    Mr President.

    Can break us af:table in two columns as panelformlayout display?

    Concerning

    And the two group must be vertical, m I right?

    you want to like this-

    Column1 Column2 Column3

    column4 column 5 column6


    You can't do that with an af:table that you can do is remove two tables same viewObject, sharing the same iterator and take a few columns in the first table years based in the second table and then surround the two tables with a layout of the Panel group (vertical)

    or take a look at the id of the pivot table, it fits in your case.

    http://docs.Oracle.com/CD/E12839_01/Web.1111/b31973/dv_crosstab.htm#ADFUI3073

    Ashish

  • Create two columns and floated in a footer

    Hello everyone!

    I'm a bit new to webcoding...

    What I need help is to create two columns in a page footer section, with the floating attributes.

    What I have tried is to add two div in the footer section, but when I specify to be floated in the footer, they end up BEING ABSENT.

    Would REALLY appreciate your response and support!

    Thank you and best what is the Sweden

    Andreas

    The problem is caused by floating children and the item container not self clearing floats.

    Have a look at this article.

  • Need to alter (widen) a varchar column, then add two zeros.

    I dug a table of VARCHAR2 column (3) in varchar2 (5)
    and I need to update the 945 values that are not null with two zeros.
    However, when I widened the column he added 2 spaces on the right

    ALTER TABLE source_inspection change)
    afs_action_number VARCHAR2 (5)
    );
    Modified table.


    SQL > Select afs_action_number
    2 from source_Inspection
    3 where afs_action_number is not null;

    AFS_A
    -----
    526
    526
    525
    524
    123
    523
    123
    123
    WWW
    123
    521

    11 selected lines.

    My goal is to increase the column width
    Then the lpad/prefix two zeroes to the left of the number.
    -to go from 123__ to 00123
    How can i:
    (1) expand the column and put the spaces to the left?
    (2) then add two zeros after enlargement?
    (I don't want to change the column varchar2 to a number).

    Thank you!

    Please explain in detail.

    Something like that?

    update source_inspection
          set afs_action_number='00'||trim(afs_action_number)
          where afs_action_number is not null
    

    Arun-

  • Compare two columns and get the percentage of cells that match

    Hello

    I'm looking to take two columns of data from different tables in the same document, which should have a high enough percentage of boxes and have another cell tabulate the corresponding percentage. I can the of seem to figure out how to do this, but it seems really possible.

    Any help is greatly appreciated.

    Thank you!

    C1 = A1 = B1

    It's shorthand dethrone select cell C1 and type (or copy and paste it here) the formula:

    = A1 = B1

    Select cell C1, copy

    Select the column C, paste

    Select cell E2, and then type 'TRUE '.

    Select cell E3 and then type "FALSE".

    F2 = COUNTIF ($C, E2)

    F3 = COUNTIF ($C, E3)

    G2 = F2÷SUM(F$2:F$3)

    G3 = F3÷SUM(F$2:F$3)

  • I want to improve memory on iMac 27 in. 3.3 GHz, 5K retina. He now has two 4G of Ram. I want to add two 8 G of ram. Should I remove two 4 G, or simply add 8G in two empty slots? Going to have a mixed match (2 of 4 and 8 s 2) in trouble?

    I want to improve memory on iMac 27 in. 3.3 GHz, 5K retina. There are now two 4 G of Ram. I want to add two 8 G of ram. Should I remove two 4 G, or simply add 8G in two empty slots? There are 4 slots for RAM.  Going to have a mixed match (two 4 and two 8) in trouble? Or will it improve my speed giving me 24G of RAM?

    It will be fine as long as they are installed in pairs (and, as long as your model can handle 8 GB modules). Just install them in the empty slots. Working with word documents or online will be not much faster - you will notice the difference in speed apps to respond, with graphic design and video editing, etc or game play. The new OS versions like more RAM, so you can not go wrong there.

    FYI, you do not run iOS on an iMac - Please edit your profile to show what OS version you are using. It helps the helpers.

  • Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Hello

    2796614 wrote:

    Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Of course, it is possible.  According to what the text file looks like to, you can create an external table that treats the text file as if it were a table.  Otherwise, you can always read the file in PL/SQL, using the utl_file package and INSERT of PL/SQL commands.

    You have problems whatever you wantt?  If so, your zip code and explain what the problem is.

    Whenever you have any questions, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the exact results you want from these data, so that people who want to help you can recreate the problem and test their ideas.  In this case, also post a small sample of the text involved file.

    If you ask about a DML operation, such as INSERT, then INSERT statements, you post should show what looks like the tables before the DML, and the results will be the content of the table changed after the DML.

    Explain, using specific examples, 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: Re: 2. How can I ask a question on the forums?

Maybe you are looking for