How to identify columns that have the same data in a SQL query or function?

Deal all,

How to identify columns that have the same data in a SQL query or function? I have the sample data as below

DEPT_IDEMP_IDCome on
!CITYSTATECOUNTRY111 June 1983DELHIHUMAN RESOURCESIndia1218 January 1987DELHIHUMAN RESOURCESIndia1328 November 1985DELHIHUMAN RESOURCESIndia144 June 1985DELHIHUMAN RESOURCESIndia255 June 1983MUMBAIHDIndia266 June 1983MUMBAIHDIndia277 June 1983MUMBAIHDIndia288 Jun. 1983MUMBAIHDIndia399. June 1983GURGAONDLIndia31010 June 1983GURGAONDLIndia

Now, I want to Indify columns that have the same data for the same Department ID.

Is it possible in sql unique or do I have to write the function for this? Pls Help how to write?

Thanks in advance.

You can try this?

WITH T1)

DEPT_ID, EMP_ID, DATE OF BIRTH, CITY, STATE, COUNTRY

), ()

SELECT 1, 1, TO_DATE('1.) June 1983', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL

SELECT 1, 2, TO_DATE('18.) January 1987', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL

SELECT 1, 3, TO_DATE('28.) November 1985', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL

SELECT 1, 4, TO_DATE('4.) June 1985', 'JJ. LUN. (YYYY'), 'DELHI', 'HR', 'INDIA' OF THE DUAL UNION ALL

SELECT 2.5, TO_DATE('5.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL

SELECT 2.6, TO_DATE('6.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL

SELECT 2.7, TO_DATE('7.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL

SELECT 2.8, TO_DATE('8.) June 1983', 'JJ. LUN. (YYYY'), 'BOMBAY', 'HD', 'INDIA' OF THE DUAL UNION ALL

SELECT 3, 9, TO_DATE('9.) June 1983', 'JJ. LUN. (YYYY'), 'GURGAON', 'DL', 'INDIA' OF THE DUAL UNION ALL

SELECT 3.10, TO_DATE('10.) June 1983', 'JJ. LUN. (YYYY'), 'GURGAON', 'DL', 'INDIA' OF THE DOUBLE)

SELECT DEPT_ID,

RTRIM (XMLAGG (XMLELEMENT(A,VALS||',')). Extract ('//Text ()'), ',') COLUMNS_WITH_DUPLICATE

DE)

SELECT * FROM)

SELECT DEPT_ID,

EMP_ID,

Date of birth

CITY,

STATE,

COUNTRY

DE)

SELECT DEPT_ID,

EMP_ID,

Date of birth

CITY,

STATE,

COUNTRIES,

COUNT (*) OVER(PARTITION BY DEPT_ID ORDER BY EMP_ID DESC,DOB DESC,CITY DESC,STATE DESC, COUNTRY DESC) RN

DE)

SELECT DEPT_ID,

CASE WHEN(CEID>1) AND THEN 'YES' ELSE 'NO' END AS EMP_ID.

CASE WHEN(CDOB>1) THEN 'YES' ELSE 'NO' END AS DATE OF BIRTH,

CASE WHEN(CCITY>1) AND THEN 'YES' ELSE 'NO' END AS CITY.

CASE WHEN(CSTATE>1) AND THEN 'YES' ELSE 'NO' END AS STATE.

CASE WHEN(CCOUNTRY>1) THEN 'YES' ELSE 'NO' END AS A COUNTRY

DE)

SELECT DISTINCT

DEPT_ID,

CEID,

CDOB,

CITY,

CSTATE,

CCOUNTRY

DE)

SELECT DEPT_ID,

COUNT (*) TO THE CEID (DEPT_ID PARTITION, EMP_ID),.

COUNT (*) ON CDOB (DEPT_ID SCORE, DATE OF BIRTH),

COUNT (*) ON THE CITY (DEPT_ID PARTITION, CITY),

COUNT (*) ON CSTATE (DEPT_ID PARTITION, STATE).

COUNT (*) ON CCOUNTRY (DEPT_ID, COUNTRY PARTITION)

FROM T1)))

WHERE RN = 1)

UNPIVOT (CLO FOR (VALS) IN (EMP_ID, DATE OF BIRTH, CITY, STATE, COUNTRY)))

WHERE COLS = "YES".

DEPT_ID GROUP;

OUTPUT:

DEPT_ID COLUMNS_WITH_DUPLICATE
--------- ------------------------

1 CITY, COUNTRY, STATE
2 CITY, COUNTRY, STATE
3 CITY, COUNTRY, STATE

Post edited by: Parth272025

Tags: Database

Similar Questions

  • query to view separate lines that have the same values

    Hello

    I have the columns id, addr1, addr2, city and State of coding. I need to know all the coding IDS that have the same addresses and at the same time filter out the same side of the id of the request.

    For example:

    acctid addr1, addr2 City State

    WEF 1 101 101 sd

    1                         101          wef     sd

    WEF 2 101 101 sd

    WEF 3 101 101 sd

    DC 4 102 102 homeless

    From the above data, I want to get filter tier 4 and get lines 1, 2 and 3. How to achieve with a sql query

    Thank you

    Arch

    This has nothing to do with hard... coding is how you test a query without creating the table, so you'd:

    with match_finder AS (SELECT acctid, addr1, addr2, city, State, count (*) OVER (PARTITION BY addr1, addr2, city, province) AS identical_rows)

    OF )

    Select acctid, addr1, addr2, city, province

    of match_finder

    where identical_rows > 1

    /

    and the rest, I'm sure, you can find on your own...

    HTH

  • two elements that have the same source

    Hi guys,.

    I am trying to use the display on a Google Map plugin location. As I had this plugin requires two elements that have the same source:

    Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
    2 - Google Map plugin ELEMENT to visualize on the map. The source of this issue should also be "Map" the column that is used to read the address.

    But the problem, as you saw, we can not create a new record if we have two items with the same source. How can I get around this?

    Here is the link to the plugin:

    http://Apex.Oracle.com/pls/Apex/f?p=plugins:LOCATION_MAP:2943553726537511

    Kind regards
    Fateh

    Published by: Fateh July 21, 2011 02:52

    Hi Fateh,

    Tried the plugin you mentioned! Had a preview of your problem.
    >
    I am trying to use the display on a Google Map plugin location. As I had this plugin requires two elements that have the same source
    >
    As your form seems to be running automatic process line processing DML that will obviously give an error if you have two items
    with the same source i.e. 'MAP' that is your database column.
    >
    Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
    >
    I think that this point is already with you as you may have created form based on a Table or form and report based on a Table.
    Leave the source of this article because it's IE card - the database column.
    >
    2 - Google Map plugin ELEMENT to visualize on the map.
    >
    Change the source of this article as:
    Source type: static assignment (value corresponds to the source attribute)
    Source of value or expression:

    &P1_ADDRESS.
    

    Where P1_ADDRESS is the element:
    >
    Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
    >

    I hope that helps!
    Kind regards
    Kiran

  • Only GET records that have the same values of field has the same value in field B

    Have a hard time with below, please help.

    Here's the situation:

    create table cord (identification NUMBER, CM VARCHAR2 (3), PM VARCHAR2 (2));
    insert into string values (1, '002', 'H1');
    insert into string values (2, '006', 'H1');
    insert into string values (3, '004', 'H2');
    insert into string values (4, '006', 'H2');
    insert into string values (5, '004', 'H3');
    insert into string values (6, '004', 'H3');

    I just need to select the folders which, for the SAME value of PM have the same value in CM, in example above, those are recordings with ID (5,6).

    1 and 2 fail because for them CM and PM are different for the same H1, similar on the 3 and 4.

    I don't know if this will help but records are always in 'pairs', which means that there are no cases as

    7. '004' | H4

    8. ' 006' | H4

    9. '005' | H4

    Any ideas are much appreciated.

    Thank you

    See if the following can help...

    select id,cm,pm
        from(
            select t.*
                  ,count(1) over(partition by cm,pm) cnt
                from testt t
            )
        where cnt>1;
    
  • Stuck on a sql query to search for records that have the same parent child records

    Oracle 10 g 2 Enterprise Edition.

    Hello

    I'm writing a logic to find records in a parent table, who have the same values in a child table.
    This is part of a larger application, but I am stuck on that part for now, so I have mocked some of the below simplified tables to capture the heart of the
    the problem is that I'm stuck.
    Let's say I have a responsible parent, child employee table table and there are a number of many relationships between them.
    The aptly named Join_Table manages the relationship between them. If a manager can manage several employees, an employee can be managed by
    many managers.

    I have a feeling it's stupidly easy, but it seems to me having a bad episode of brain freeze today!
    -- parent table
    CREATE TABLE manager (
     id      number primary key,
     name      varchar2(100));
    
    -- child table 
    CREATE TABLE employee (
     id          number primary key,
     name      varchar2(100));
    
    -- link table
    CREATE TABLE join_table (
     manager_id          NUMBER, 
     employee_id      NUMBER,
     CONSTRAINT join_table_pk PRIMARY KEY (manager_id, employee_id),
     CONSTRAINT manager_fk FOREIGN KEY (manager_id) REFERENCES manager(id),
     CONSTRAINT employee_fk FOREIGN KEY (employee_id) REFERENCES employee(id) 
     );
    
    -- Insert some managers
    INSERT INTO manager (id, name) VALUES (1, 'John');
    INSERT INTO manager (id, name) VALUES (2, 'Bob');
    INSERT INTO manager (id, name) VALUES (3, 'Mary');
    INSERT INTO manager (id, name) VALUES (4, 'Sue');
    INSERT INTO manager (id, name) VALUES (5, 'Alan');
    INSERT INTO manager (id, name) VALUES (6, 'Mike');
    
    -- Insert some employees 
    INSERT INTO employee (id, name) VALUES (101, 'Paul');
    INSERT INTO employee (id, name) VALUES (102, 'Simon');
    INSERT INTO employee (id, name) VALUES (103, 'Ken');
    INSERT INTO employee (id, name) VALUES (104, 'Kevin');
    INSERT INTO employee (id, name) VALUES (105, 'Jack');
    INSERT INTO employee (id, name) VALUES (106, 'Jennifer');
    INSERT INTO employee (id, name) VALUES (107, 'Tim');
    
    -- Insert the links
    -- John manages Paul, Simon, Ken
    INSERT INTO join_table (manager_id, employee_id) VALUES (1, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (1, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (1, 103);
    -- Bob manages Paul, Simon, Kevin, Jack
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 104);
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 105);
    -- Mary manages Jennifer, Tim
    INSERT INTO join_table (manager_id, employee_id) VALUES (3, 106);
    INSERT INTO join_table (manager_id, employee_id) VALUES (3, 107);
    -- Sue manages Jennifer, Tim
    INSERT INTO join_table (manager_id, employee_id) VALUES (4, 106);
    INSERT INTO join_table (manager_id, employee_id) VALUES (4, 107);
    -- Alan manages Paul, Simon, Ken, Jennifer, Tim
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 103);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 106);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 107);
    -- Mike manages Paul, Simon, Ken
    INSERT INTO join_table (manager_id, employee_id) VALUES (6, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (6, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (6, 103);
    
    -- For sanity
    CREATE UNIQUE INDEX employee_name_uidx ON employee(name);
    If I ask for Manager John, so I want to find other managers who manage the exact list and even employees.
    Answer should be Mike.
    If I ask for Manager of Mary, the answer should be Sue.

    This query will give me the list of managers who manage some of the same employees as John, but not the same employees accurate...
    SELECT DISTINCT m.name AS manager
    FROM manager m, join_table jt, employee e
    WHERE m.id = jt.manager_id
    AND jt.employee_id = e.id
    AND e.id IN (
         SELECT e.id
         FROM manager m, join_table jt, employee e
         WHERE m.id = jt.manager_id
         AND jt.employee_id = e.id
         AND m.name = 'John')
    ORDER BY 1;
    I thought about using set operations to find managers with a list of employees less than my employees is null and where my employees under their list of employees is null. But there must be an easier way more elegant.
    Any ideas?
    BTW, I need to run as a batch on tables with > 20 million rows so the efficiency of queries is key.

    What about...

    WITH manager_list AS
    (
     SELECT name,
            LTRIM(MAX(SYS_CONNECT_BY_PATH(id,','))
            KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
     FROM   (SELECT m.name,
                    e.id,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) AS curr,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) -1 AS prev
             FROM   manager m,
                    join_table jt,
                    employee e
      WHERE m.id           = jt.manager_id
      AND   jt.employee_id = e.id
      AND   m.name = :P_MANAGER)
      GROUP BY name
      CONNECT BY prev = PRIOR curr AND name = PRIOR name
      START WITH curr = 1
    ), all_list AS
    (
     SELECT name,
            LTRIM(MAX(SYS_CONNECT_BY_PATH(id,','))
            KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
     FROM   (SELECT m.name,
                    e.id,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) AS curr,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) -1 AS prev
             FROM   manager m,
                    join_table jt,
                    employee e
      WHERE m.id           = jt.manager_id
      AND   jt.employee_id = e.id)
      GROUP BY name
      CONNECT BY prev = PRIOR curr AND name = PRIOR name
      START WITH curr = 1
    )
    SELECT a.*
    FROM   manager_list m,
           all_list a
    WHERE  m.employees = a.employees
    

    Would be easier in 11g, but I do not have a facility here so this is based on 10g.

    See you soon

    Ben

  • Read the nodes that have the same value as the subnodes - XML

    It is more of a general JAVA / XML problem, but given that it is going into my BlackBerry app I thought I'd see if anyone knows.

    Consider a simple XML document:

                        Whatever 1                   Whatever 2               Whatever 3       
    

    Using the standard org.w3c.dom, I can get the nodes in X by the practice...

    NodeList fullnodelist = doc.getElementsByTagName ("x");

    But if I want to go to the next set of 'e', I try to use something like...

    Element element = (Element) fullnodelist.item(0);NodeList nodes = pelement.getElementsByTagName("e");
    

    EXPECTED back '3' nodes (because there are 3 series of 'e'), but it returns '9' - because it gets all entries including the 'e' apperently.

    It would be nice in the above case, because I could probably go through and find what I'm looking for. The problem I have is that when the XML file looks like the following:

                whatever              Something Else                    whatever              Something Else            
    

    When I ask 'e' value, it returns 4, instead of (what I want) 2.

    I am simply not understand how DOM parsing works? Generally, in the past I used my own XML documents so I name never articles like this, but unfortunately this isn't my XML file and I don't have the choice to work like this.

    What I thought I would do, it is write a loop knots "drills down" so that I can combine each node...

      public static NodeList getNodeList(Element pelement, String find)
        {
            String[] nodesfind = Utilities.Split(find, "/");
            NodeList nodeList = null;
    
            for (int i = 0 ; i <= nodesfind.length - 1; i++ )
            {
                nodeList = pelement.getElementsByTagName( nodesfind[i] );
                pelement = (Element)nodeList.item(i);
            }
    
            // value of the nod we are looking for
            return nodeList;
        }
    

    .. While if adopted you ' s/e' in the service, he would return the 2 nodes I'm looking (or elements, perhaps I'm using the wrong terminology?). on the contrary, it returns all the 'e' nodes in this node.

    Anyway, if anyone is still with me and has a suggestion, it would be appreciated.

    Well, there is no doubt that there is a learning curve robust for XML programming. You can take an hour or two and go through one of the tutorials that are circulating on the net. (Like that of w3schools.com.)

    Basically, almost everything in XML is a node, the Document that returns the parser. The API for node tells you that you can test the node type you have by calling getNodeType, which returns one of the constants of type node (Node.ELEMENT_NODE, Node.TEXT_NODE, etc..) If necessary, you can then convert the variable to the corresponding interface (element, text, etc.).

    Similarly, the API documentation say you for any node, calling getChildNodes (or for an element node or Document getElementsByTagName) will give you a NodeList (a little non-types of nodes in the XML API), while calling getFirstChild and getNextSibling to any node will give you another node (or null ).

    Once you learn the API, writing logic of course is not all that hard. For example, if the only 'e' interest tags are those directly under the element root of the document (as shown in your example) you can simply go to them directly:

    Vector getTopENodes(Document doc) {  Vector vec = new Vector();  NodeList nodes = doc.getDocumentElement().getChildNodes();  int n = nodes.getLength();  for (int i = 0; i < n; ++i) {    Node node = nodes.item(i);    if (node.getNodeType() == Node.ELEMENT_NODE &&        "e".equals(node.getNodeName()))    {      vec.addElement(node);    }  }  return vec;}
    

    Note that this example does not assume that all children are nodes of element 'e '. the document could have comments, white space or something else that makes it into the DOM as comment, text or any other type of node.

    On the other hand, if you want to capture every "e" tag which is directly under the ' tag, no matter the level, then you need to do something a little more complicated (it's on the top of my head - no guarantee):

    static class NodeListImp implements NodeList {  private Vector nodes = new Vector();  public int getLength() {    return nodes.size();  }  public Node item(int index) {    return (Node) nodes.elementAt(index);  }  public add(Node node) {    nodes.addElement(node);  }}
    
    NodeList getTargetNodes(Document doc) {  NodeListImp list = new NodeListImp();  getTargetnodes(list, doc.getDocumentElement(), false);  return list;}
    
    void getTargetNodes(NodeListImp list, Node node, boolean parentIsS) {  if (node.getNodeType() == Node.ELEMENT_NODE) {    // node name is tag name for element nodes    String name = node.getNodeName();    if (parentIsS && "e".equals(name)) {      list.add(node);    }    parentIsS = "s".equals(name);    for (Node child = node.getFirstChild();         child != null;         child = child.getNextSibling())    {      getTargetNodes(list, child, parentIsS);    }  }}
    

    I hope that it gets the idea across.

  • I have a Mac Book (2006), all my emails since two and a half years have the same date. How to bring back the original dates?

    Of 'date and time' I tried to drag the month and year of my menu bar. He did not stay, I did several times, but nothing helped. I closed the window and went back to my Thunderbird email to see the date, I tried to use became the date in the column "date of receipt" of all of my emails back for 2011. I changed the date a few days later, and then the date is changed on all my emails. I want to cancel everything I done the dates so that the emails show when they were initially received. I managed to get "the order received" which helps a little, but I don't see the original dates.

    I checked "set date and time automatically", but it does not change the dates on my saved emails.

    Of 'date and time' I tried to drag the month and year of my menu bar.

    Is this something Mac?

  • How to determine how many times result set have the same value

    HI -.

    I do a report that will be used for the analysis of trends in payment.

    My initial result set looks like this:
    HOUSEHOLD_ID     JAN_PMT     FEB_PMT     MAR_PMT     APR_PMT     MAY_PMT     JUN_PMT     JUL_PMT     AUG_PMT     SEP_PMT     OCT_PMT     NOV_PMT     DEC_PMT
    90026845409     1     1     1     1     2     1     1     1     1     0     1     0
    (number of lines, of course, pivot table result set)

    I need to determine the households that have a value > 0 in three or more consecutive months.

    I hope that someone will have some suggestions because that the only solutions I come up with right now would be a nightmare of coding (lots of "GOLD"), and I assume (hope) there's a better solution out there.

    Thank you!
    Christine

    If you are limited to only 12 months I would use GOLD in conjunction with the sign function.

    sign of a positive number returns 1
    sign of 0 returns 0
    sign of a negative number returns - 1

    Really, it doesn't look like bad lto for me. Obviously if you have a numbe rof months variable must be a different solution.

    with the data
    as
    (
    Select hh '90026845409', 1 jan, Feb 1, 1 March, 1 April, 2 may, 1 June, 1 July, August 1, 1 sep, oct, 1 nov, dec double 0 0
    )
    Select * from data
    where
    (sign (jan) sign (feb) + sign (mar)) = 3
    or
    Sign (Feb) + Sign (Tue) + Sign (APR) = 3
    ...
    or
    Sign (Oct) + Sign (Nov) + Sign (DEC) = 3

  • How to create a formula that highlights the cell that contains the same data that I type in another cell

    Hi, can someone help me make a formula which detects and highlights the value of the cell that contains the items of data that I entered in another cell? Thank you

    resolved to myself

  • Transform a string that displays hex data in normal format, in a string that has the same data in hexadecimal format

    I have a string of arbitrary length - say, 1AB1C0 - normal format. I would like to have a function that takes this string in and generates the same accurate, but in hexadecimal characters. If the entry will read 1AB1C0 in the normal string format, and the output will read 1AB1C0 as a hexadecimal string.

    I'm doing this because I found that the terminal works better if I send the bytes string hexadecimal vs as an array of U8. Furthermore, I handle a lot of byte stream in my program and I find the chain tools less cumbersome to use against the array of bytes to analysis of analysis tools - however, they operate only on strings as they appear in normal mode. So I have reasons in different parts of my program to have the channel under conditions normal vs formats hexadecimal; but I can't understand anyway elegant remotely to cast from one to the other.

    CraigRem wrote:

    If the entry will read 1AB1C0 in the normal string format, and the output will read 1AB1C0 as a hexadecimal string.

    Well, you must sweep the bytes of the string formatting hexagonal two at a time for a digital U8 and then cast to a string. There are several ways to do it, here are the two possibilities. (Sure to use the correct representation as Mkae labels).

    (I still don't understand your reasoning why you need).

  • ORA-01790 Expression must have the same data type

    select  'sal' as A, sal as B, sal as C, sal as D
    from
    (Select sum(sal) sal from emp)
    union all
    select
      'comm', comm, comm, comm
    from
    (Select sum(comm) comm from emp)
    union all
    select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
    Get the following error when you run the above query. I know it's because of the rpad('-',10,'-') what is the best way to achieve the expected results

    I would like to have the result with underscore. What is the best way to achieve this.

    Expected results:
    I am developing report.
    I need to have the following oupput.
    How can I put underscore after the recordings.
     A              B        C             D        
    sal         29025       29025     29025
    comm     2200    2200     2200
    --------------------------------------------------
    SQL> select  'sal' as A, sal as B, sal as C, sal as D
      2  from
      3  (Select sum(sal) sal from emp)
      4  union all
      5  select
      6    'comm', comm, comm, comm
      7  from
      8  (Select sum(comm) comm from emp)
      9  union all
     10  select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
      'comm', comm, comm, comm
              *
    ERROR at line 6:
    ORA-01790: expression must have same datatype as corresponding expression
    
    SQL> select  'sal' as A, to_char(sal) as B, to_char(sal) as C, to_char(sal) as D
      2  from
      3  (Select sum(sal) sal from emp)
      4  union all
      5  select
      6    'comm', to_char(comm), to_char(comm), to_char(comm)
      7  from
      8  (Select sum(comm) comm from emp)
      9  union all
     10  select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
    
    A          B                                        C                                        D
    ---------- ---------------------------------------- ---------------------------------------- ------------------
    sal        29025                                    29025                                    29025
    comm       2200                                     2200                                     2200
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    
    A          B                                        C                                        D
    ---------- ---------------------------------------- ---------------------------------------- ------------------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    ---------- ----------                               ----------                               ----------
    
    16 rows selected.
    
    SQL> 
    

    SY.

  • How to handle multiple formats of date to the same date field in SQL * Loader

    Dear all,

    I have a requirement where I need to get data from a text file and even insert into the oracle table.

    I'm using SQL * Loader to fill data from the text file in my table.

    The file has an area where I expect to date data date in different formats, such as MON/dd/yyyy mon/dd/yyyy mon/dd/yyyy, dd/mm/yyyy, DD/month/yyyy.

    When you use SQL * Loader, I can see loading fails for records where we have formats such as LUN/jj/aaaa, Mon/dd/yyyy, DD/month/yyyy.

    Is it possible in SQL * Loader where we can mention all these date formats so that data from that date should go smoothly in the underlying date column in the table.

    Receive your answer on that.

    Thank you
    Madhu K.

    I think following could be the solution to your problem:

    Suppose if you have data from four different date formats, you need to load the data into four different tables by running SQL * Loader four times and each time specify other date format in the control file whose data to load, and then at the end, merge data from these four different tables using the UNION clause.

    Elya

  • How to make an image have the same link on every page?

    Basically, I have over 100 pages on this site that I'm working on. I recently changed an image or two or three, and now the previous links are bad for the new image. For example the ~ (home) ~ button goes to the search page. And I reallllllly won't change each page if I have to. How can I make the 'House' image always link to the home page for any page that is under the site?

    Thank you!

    CTRL + F = find and replace.

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

  • How to create two different smart albums with photos with the same date?

    I created a smart album by using 'Date is' and ' keyword is EAA.»  (The photos have a keyword like "EAA" or "Flower".  Photos of keyword EAA & flower have the same date.)  When I use "Corresponding to all" are has no pictures in the album.  When I use "Match any" all the photos are in the album - EAA & flower.  I would like an album with only pictures of CEA for that date and another album with photos of flower with the same date.

    I get the same answer.  I can get the date and to a key word to work with 'all' selected, but not date and keywords.  So you will need two smart albums: one with date and ECA ('all' selected) and the other with date and flowers ('all' selected).

    Use the file menu option ➙ new Smart Album.

    Report the problem to Apple via https://www.apple.com/feedback/photos.html.

  • How to paint two ObjectChoiceField on the same line

    Hello Experts!

    I tried to draw two ObjectFieldChoice on the same line, but the work doesn´t, I found this post that have the same problem as me, but the fix doesn´t works for me.

    My code:

    ...
                      String[] tipos = new String[] {"BLA1", "BLA2" };
            _tipo = new ObjectChoiceField(null, tipos, 0, FIELD_VCENTER) {
                protected void layout(int width, int height) {
                    super.layout(width - 235, height);
                }
            };
            _tipo.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1)));
            _tipo.setFont(Utils.getFont());
    
            FCLabelField lblTipo = new FCLabelField(_tipo_filtro, FIELD_VCENTER, false);
    
            String[] opcoes = new String[] { "BLA3", "BLA4", "BLA5", "BLA6"};
            _situacao = new ObjectChoiceField(null, opcoes, 0, FIELD_VCENTER) {
                protected void layout(int width, int height) {
                    super.layout(width - 346, height);
                }
            };
            _situacao.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1)));
            _situacao.setFont(Utils.getFont());
    
            FCLabelField lbl = new FCLabelField(_filtro, FIELD_VCENTER, false);
    
            CustomButtonField btConsultar = new CustomButtonField("Submit");
            HorizontalFieldManager hfmButton = new HorizontalFieldManager(FIELD_VCENTER);
            hfmButton.add(btConsultar);
    
            HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_LEFT);
            hfm.add(lblTipo);
            hfm.add(_tipo);
            hfm.add(lbl);
            hfm.add(_situacao);
                      add(hfm);
    ...
    

    I m waitting for more help.

    Best regards, Rampelotti

    The way I would approach this scenario is firstly by adding two fields of object list to a horizontal management.

    Resize the fields until they are exactly where you want to be.

    Once you did, then you can begin to add the label fields, centering, resizing and so on.

    Do it step by step.

    Also subtract 200 + pixels in width is not a good idea, especially on small devices.

    Hope this helps

Maybe you are looking for