outer join while selecting the date max

Hello
Oracle 11g R2.

I want to build a query that joins outside between 2 related tables, but selects only the date max if more than 1 record returned for a given customer. Here are the tables I and some records.

create table customer (NumCli number, name varchar2 (100))
create table orders (ordnum number, NumCli number, date orddate)

insert into customers values (1, 'ABC')
insert into customer values (2, 'DEF')
insert into customer values (3, 'ABC')
insert into customer values (4, 'DEF')

insert into orders values (1, 1, sysdate)
insert into orders values (2, 1, sysdate + 1)
insert into orders values (3, 2, sysdate + 2)

I created the following query, but it returns the two dates for NumCli = 1. I want to display the name of the client no matter if he has a prescription. But if there is more order, I want display the folder with the date max.

Select a.custnum, b.SID, b.orddate
client a, b of orders
where a.custnum = b.custnum (+)
and b.orddate (+) < = sysdate + 10 - additional criteria as part of the edition

It is a simplified example of a more complex query, that I am trying to solve. If possible, could you please suggestion a request without the use of analytical functions or inline views?
Thank you!!

Published by: arizona9952 on April 4, 2013 22:05

arizona9952 wrote:
Thanks Jac. Any way to do this without a group of?

Is there a particular reason not to use MAX?

It will be difficult to find a maximum date without a group of... If it's ok for you to have everything available, you can use the correlated sub query...

select a.custnum, a.name,
         (
           select b.orddate
           from   orders b
           where b.custnum = a.custnum
           and b.orddate <= sysdate + 10
           and rownum = 1 ) ordddate
from customer a

Tags: Database

Similar Questions

  • Oracle: Use LEFT OUTER JOIN, but convert the data to an external list

    Hello, all,.

    I know it can be done; I just don't remember how I got it done, oh there are so many years.

    Assumes that the tables exist for groups and individuals.  People can belong to several groups.

    SELECT g.groupName, p.lastName || ', ' || p.firstName as fullName
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON gpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    ORDER BY g.groupName, fullName
    

    This gives us:

    Group One          Alpha, Daniel
    Group One          Bravo, Charles
    Group One          Charlie, Chuck
    Group Two          Beta, Alpha
    Group Two          Delta, Bonnie
    Group Three        Echo, Bunny
    Group Three        Golf, Samuel
    Group Three        November, Stan
    

    How word the SQL to get the data as:

    Group One          Alpha, Daniel | Bravo, Charles | Charlie, Chuck
    Group Two          Beta, Alpha | Delta, Bonnie
    Group Three        Echo, Bunny | Golf, Samuel | November, Stan
    

    V/r,

    ^_^

    I finally thought to it.  I was using incorrect keywords on Google.

    SELECT g.groupName, LISTAGG(p.lastName || ', ' || p.firstName,' | ') WITHIN GROUP (ORDER BY g.groupName) "fullName"
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON ggpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    GROUP BY g.groupName
    ORDER BY g.groupName, fullName  
    

    Just in case someone else is going through this same desire.

    HTH,

    ^_^

  • Select the data in a table and update in another table

    Dear experts,

    create the table TB_ENCRYPT

    (

    Identification number,

    Varchar2 (200) KEY

    );

    INSERT INTO TB_ENCRYPT VALUES(1,'HJUVHDUIFBSDGVU');

    SELECT * FROM TB_ENCRYPT;

    1 HJUVHDUIFBSDGVU

    create TABLE users)

    username, NUMBER of

    password VARCHAR2 (200)

    );

    Insert users

    values (1, 123 # "")

    Insert users

    values (2, 456 #')

    Select * from users;

    1 123 #.

    # 2 456

    I want to select the data KEY for table TB_ENCRYPT column and update in the column of tables for the respective key user password

    TB_ENCRYPT table contains only a single key value. Comparing this key, I want to update the old value of the key to the new value.

    For encryption and decryption I followed the java class method.no is worried about that.

    create or replace

    PACKAGE PCK_ENC AUTHID CURRENT_USER AS

    FUNCTION DECRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.decrypt (java.lang.String, java.lang.String) return java.lang.String ';

    FUNCTION ENCRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.encrypt (java.lang.String, java.lang.String) return java.lang.String ';

    END;

    SELECT PCK_ENC. ENCRYPT('1234','HJUVHDUIFBSDGVU') FROM DUAL;

    HERE,

    1234 - is the password of the users table column data

    HJUVHDUIFBSDGVU - represents the key of table TB_ENCRYPT column data.

    Comparing this key, I want to update the old value of the key to the new value.

    I tried with this method

    declare

    cursor c1 is

    Select the key

    of TB_ENCRYPT

    where id = 1

    update the id;

    Start

    for c1_rec looping c1

    update users

    password is PCK_ENC. Encrypt (Password, Key)

    the location being c1;

    commit;

    end loop;

    end;

    /

    Help, please

    You can use the MERGE statement.

    merge into users
    using tb_encrypt
       on (id = userid)
      when matched then
          update set password = PCK_ENC.ENCRYPT(password,key);
    

    And why you encrypt your password. This isn't a good idea. Just password hash.

  • Outer join - problem with the name of the table in the select list

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    create table (j1)

    number of C1,

    number of C2);

    create table (j2)

    number of C1,

    number of C2);

    insert into values j1 (1, 10);

    insert into j1 values (1, 100);

    insert into values j1 (1, 1000);

    insert into values j2 (1, 2);

    insert into values j2 (1, 4);

    insert into values j2 (1, 8);

    commit;

    Select c1, j1.c2, j2.c2 of outer join of j1 j2 using (c1); - DOES NOT

    Select c1, j1 j2 (c1) using outer join j2.c2. - WORK

    Why?

    Hello

    Interesting question!  Oracle goes very far in trying not to trigger an error.

    The OUTER keyword (if used; it is always optional) must be preceded by one of the keywords, right or LEFT.  Since neither LEFT, RIGHT, or FULL comes before OUTER in queries in your first message, it does not recognize as keyword OUTER and treats him like a table alias for table j1.  Since j1 has an alias, the real table name cannot be used in the SELECT clause.  This query is executed:

    SELECT c1

    outer.c2

    j2.c2

    External J1

    Join the HELP of j2 (c1)

    ;

    There is an INTERNAL join.  Add to your sample data:

    insert into values of j1 (-1, -10);

    insert into values of j2 (-2, -20);

    to be specified.

    Moreover, USING is short for confUSING.  I suggest you use IT for all the join conditions.  Everyone (unless they you write or read a manual) does.

  • Select the year max and max date for a code

    Hello

    I need to extract max year and month max for one code particulare.

    My table contains:

    YEAR MONTH CODE

    ====   =====    ====

    2014 6 X

    2014 7 X

    2013 5 Y

    2013 6 Y


    I need to extract:


    2014 7 X

    2013 6 Y


    I don't like max(YEAR|| le mois), I want the column separated.


    Thank you

    Try this:

    WITH test_data AS (
      SELECT 2014 AS yr, 6 AS mth, 'X' AS code FROM DUAL
      UNION ALL
      SELECT 2014 AS yr, 7 AS mth, 'X' AS code FROM DUAL
      UNION ALL
      SELECT 2013 AS yr, 5 AS mth, 'Y' AS code FROM DUAL
      UNION ALL
      SELECT 2013 AS yr, 6 AS mth, 'Y' AS code FROM DUAL
    )
    SELECT yr
         , MAX(mth) KEEP (DENSE_RANK FIRST ORDER BY 100*yr+mth DESC) AS mth
         , MAX(code) KEEP (DENSE_RANK FIRST ORDER BY 100*yr+mth DESC) AS code
    FROM   test_data
    GROUP BY yr
    ORDER BY 1;
    

    Obviously by storing your dates as the DATE, then ranked by who would be more elegant!

  • OUTER JOIN query returns the results of JOIN IN-HOUSE 11.2.0.1.0

    I'm data transfer in 11.2.01.0 (Windows XP 32-bit) and I wanted to compare the sizes of table with the same Table name in two different patterns, ML and SILENT, with a FULL OUTER JOIN (to account for all the tables and NULL values in a diagram).

    The scheme of ML has 176 tables: schema TUT a 133 tables. The use of a standard INNER JOIN gives 131 paintings.

    I get precisely the results with a FULL OUTER JOIN I get with an INTERNAL JOIN (not the same NULL values so I know they exist).

    This happens in SQL-Plus, SQL_Developer and using Oracle Wire pilot of Data_Direct.

    Here is the code:

    Login: SYS as SYSDBA or SYSTEM (same results for either)

    SELECT M.TABLE_NAME, M.NUM_ROWS, T.TABLE_NAME, T.NUM_ROWS
    OF SYS. ALL_TABLES M FULL OUTER JOIN SYS. ALL_TABLES T ON M.TABLE_NAME = T.TABLE_NAME
    WHERE
    M.OWNER = 'ML' AND
    T.OWNER = 'TUT';

    Produce the same results with LEFT OUTER joins and RIGHT OUTER joins in ASI and Oracle (+) syntax.

    Any thoughts?

    Hello

    If you read what I posted, forget it. MScallion (below) gave the correct answerr.

    If conditions such as

    owner   = 'ML'
    

    in the WHERE clause, and then they will reject the rows of the result set formed by the join condition.

    The inner join returns only 131 lines where the two 'paintings' have the same table_names.
    The outer joins return multiple lines (133, 176 or 178) before the place WHERE the provision is applied , but the WHERE clause eliminates all lines except the 131 found by the inner join.

    Published by: Frank Kulash, July 10, 2010 14:23

  • Outer join to find the missing?

    I have 2 tables:

    with stud_courses as
    (
    Select studentid 111, 2, 2201 coursecategory courseid, 'A' GRADE of double
    Union
    Select studentid 111, 2, 2203 coursecategory courseid, CATEGORY "B" of the double
    Union
    Select studentid 111, 4 coursecategory, 2121 courseid, 'A' GRADE of double
    Union
    Select studentid 222, 3 coursecategory, 1111 courseid, 'A' GRADE of double
    Union
    Select studentid 222, 3 coursecategory, 1112 courseid, 'A' GRADE of double
    )
    course_categories as
    (
    Select 2 coursecategory, 2201 courseid double
    Union
    Select 2 coursecategory, 2202 courseid double
    Union
    Select 2 coursecategory, 2203 courseid double
    Union
    Select 2 coursecategory, 2204 courseid double
    Union
    Select 3, 1110 coursecategory courseid double
    Union
    Select 3 coursecategory, 1111 courseid double
    Union
    Select 3 coursecategory, 1112 courseid double
    Union
    Select 3 coursecategory, 1113 courseid double
    Union
    Select 4 coursecategory, 2120 courseid double
    Union
    Select 4 coursecategory, 2121 courseid double
    Union
    Select 4 coursecategory, 2122 courseid double
    Union
    Select 4 coursecategory, 2123 courseid double
    )

    For each student, wants to add the missing courseids for the coursecategory he takes. So student because 111 is in coursecategory 2 I should be able to show all results for him, including the ID of course 2202 and 2204 of category 2 and 2120, 2122, 2123 for this child

    My end result would be something like:

    StudentID, courseid, coursecategory, grade
    111,2,2201, "A".
    111,2,2201, '
    111,2,2203, 'B '.
    111,2,2201, '
    111,4,2120, '
    111,4,2121, "A".
    111,4,2122, '
    111,4,2123, '
    222,3,1110, '
    222,3,1111, "A".
    222,3,1112, "A".
    222,3,1113, '

    I know how to do it with a Union and not exists, but I was wondering if I could do it with an outer join.

    I would appreciate your help.

    Thank you

    Hello

    Yes, you can do it with an outer join. The tricky thing is you need outside to join the table real stud_courses to something that has valid all combinations of the studnents and prices. There is no single table that contains it; the following query will receive these combinations by making a cross join:

    WITH     all_students     AS
    (
         SELECT DISTINCT     studentid
         FROM          stud_courses
    )
    ,     got_category_cnt     AS
    (
         SELECT     all_s.studentid
         ,     c.coursecategory
         ,     c.courseid
         ,     NVL ( s.grade
                  , 'M'
                  )               AS grade
         ,     COUNT (s.grade) OVER ( PARTITION BY  all_s.studentid
                                     ,          c.coursecategory
                             )      AS category_cnt
         FROM           all_students         all_s
         CROSS JOIN      course_categories  c
         LEFT OUTER JOIN      stud_courses         s  ON    s.studentid     = all_s.studentid
                                             AND   s.courseid          = c.courseid
    )
    SELECT       studentid
    ,       coursecategory
    ,       courseid
    ,       grade
    FROM       got_category_cnt
    WHERE       category_cnt     > 0
    ORDER BY  studentid
    ,       coursecategory
    ,       courseid
    ,       grade
    ;
    

    The results I get are:

    `STUDENTID COURSECATEGORY   COURSEID G
    ---------- -------------- ---------- -
           111              2       2201 A
           111              2       2202 M
           111              2       2203 B
           111              2       2204 M
           111              4       2120 M
           111              4       2121 A
           111              4       2122 M
           111              4       2123 M
           222              3       1110 M
           222              3       1111 A
           222              3       1112 A
           222              3       1113 M
    

    These are a little different from what you have posted.

    user9207291 wrote:
    ...
    StudentID, courseid, coursecategory, grade
    111,2,2201, "A".
    111,2,2201, '
    111,2,2203, 'B '.
    111,2,2201, '
    111,4,2120, '
    111,4,2121, "A".
    111,4,2122, '
    111,4,2123, '
    222,3,1110, '
    222,3,1111, "A".
    222,3,1112, "A".
    222,3,1113, '

    Is it because there are errors in what you posted? Do you really want to have three lines of output for the same studentid (111) and courseid (2201)?

    Looks like there should be a slick way to do this with a partitioned outer join.
    A partitioned outer join matches each row of table A with the lines in table B, but, if there is no correspondence between a given A line and a line to a given partition of B, that the rank of A and the B partition is included in the game anyway. Here, we want the two partition tables.

  • Query is not pulling the date max

    I'm trying to get the date higher within a table and the matching records. Instead he shoots all the dates. I use max and grouped by ID. Rather than show the 10465 ID once it appears twice. Same for 10860 and 1831. There should be only three records not posted 7.

    I'm using CF7 with a database of sybase Adaptive Server Enterprise version 12.0.0.8.

    Thanks for the help.

    This gives you something like the results you're looking for?


    SELECT DISTINCT t1. EFFDT date,
    T1. EMPLID,
    T1. DESCR
    TITLES LIKE t1
    WHERE t1. EMPLID ('10465 ', '10860', ' 1831')
    AND t1. EFFDT = (SELECT MAX (t2. EFFDT)
    SECURITIES AS t2
    WHERE t1. EMPLID = t2. EMPLID)

    Phil

  • 383 receving error while querying the data search

    Hello

    We have a script (vbs) that runs in Diadem and asks a Datafinder (Server edition). After the addition of a code of error handling, we encountered the following error:

    Error description: an error occurred while searching. The query can contain at least one invalid property.        Number: 383 Source: false.*

    * Now, according to the message above, we can extract that there is a property or a value of the property (of the application) makes / hurt, but see the next line from this message please.

    Once we took the trap for this error, we connect and save queries (in files TDQ) which were used at the present time that the error occurred. When load us the files of this query, no error is caused. We currently have to solve this problem, but we don't find the root cause yet. No guidance, the tip or help will be greatly appreciated.

    Hi manny,.

    This looks like a problem of type of property data for me.  In rare cases save a condition of tiara in a *.tdq file can cause this condition to change the data type of the property.  You can try to reduce the number of assignments to one and determine what state is the culprit?  Then ask yourself which operator you use in this condition - if it is "=" or "<>" then it supports any type of data.  If it's any other condition, then he could run against a string data type.  In addition, you may have a datetime property that is not optimized in the DataFinder, who could be considered an invalid property.

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Error while exporting the data in an Excel sheet

    Hi all

    I created a VO that is based on the query (not based on EO) and the query is as follows:

    Select f.user_name,
    f.Description,
    a.currency_code,
    a.amount_to,
    a.amount_from
    seacds.ar_approval_user_limits_nv a, seacds.fnd_user_nv f
    where a.user_id = f.user_id
    and a.document_type = 'CM '.
    order by 2;


    Based on this original Version I created a search page that searches for and returns the data in the table and the finally export standard button will export data in excel sheet.
    In this research data based on over 5 attributes. Without entering anything in the messageTextInput if I'm clicking on this button, it returns all the data in the region of the table. After that if I click on the button export, data are getting exported to the Excel sheet. It is very good.

    But if I'm looking for data by entering a value in one of the messageTextInput, it is returned from the data. But if I'm clicking on the export button then it throws the following error:

    The exception details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: 27122 Houston: SQL error in the preparation of the statement. Statement: SELECT * FROM (select f.user_name,
    f.Description,
    a.currency_code,
    a.amount_to,
    a.amount_from
    seacds.ar_approval_user_limits_nv a, seacds.fnd_user_nv f
    where a.user_id = f.user_id
    and a.document_type = 'CM '.
    order by 2) QRSLT WHERE ((UPPER (CURRENCY_CODE) as UPPER(:1) AND (CURRENCY_CODE like: 2 OR CURRENCY_CODE as: 3 OR CURRENCY_CODE as: 4 OR CURRENCY_CODE as: 5))) ORDER OF DESCRIPTION asc
    at oracle.apps.fnd.framework.OAException.wrapperException (unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException (unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors (unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest (unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage (unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage (unknown Source)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage (unknown Source)
    in OA. jspService(_OA.java:71)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    to oracle.oc4j.network.ServerSocketReadHandler$ SafeRunnable.run (ServerSocketReadHandler.java:260)
    to com.evermind.util.ReleasableResourcePooledExecutor$ MyWorker.run (ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    # # 0 in detail
    java.sql.SQLException: invalid column type
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7895)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7572)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8183)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:8206)

    Please give me any idea to clear this error.

    Thank you and best regards,
    Myvizhi

    Hi all

    I solved the problem... I put the property to select all of the lines as false. So now I'm able to export data.

    Thank you and best regards,
    Myvizhi

  • Select the data if a value has a certain value?

    Hello, I'm trying to do...


    In pseucode, it looks like to...

    If this field has a value, then select a, b, c,... of table
    another "don't do anything".

    How can I do that, I tried...

    Select decode (LKP2. EXCLUDED_BOOK_CD, not null,
    (select 1 double),
    ('NOT NULL', 'ALL')
    OF LKP2 fcl_chunk_pid_correspondence
    WHERE LKP2. CHUNK_ID =: p_chunk_id
    AND LKP2. GCDS_ENTITY = "TRANSACTION".
    AND LKP2. EXCLUDED_BOOK_CD IS NOT NULL
    AND LKP2. UBR = "OTHER";

    But this does not work if there is not any row for where.

    Thanks in advance!

    write a case statement as

    Select the case while sal is not null, then end of sal from emp;

  • How to select the data that meet multiple criteria

    name load_date
    -------- ----------------
    Smith 11/02/2010
    John 01/10/2009
    Cindy 03/04/2010
    Smith 03/10/2010


    I want to select all names including load_date exist in February AND March.

    Expected results: -.

    Smith

    I can use the intersect operator to get all the names that were given in February AND March by using the following query.

    Select the name of the table where to_char ("load_date, ' FMMonth YYYY") = "February 2010"»
    intersect
    Select the name of the table where to_char ("load_date, ' FMMonth YYYY") = "March 2010"»


    Y at - it an easier way to retrieve the same data that is similar to the use group by, having cluase etc?

    Thanks in advance.

    Hello

    You can do it in one pass through the table with GROUP BY and HAVING:

    SELECT       name
    FROM       table_x
    WHERE       load_date     >= DATE '2010-02-01'     -- First date inside target range
    AND       load_date     <  DATE '2010-04-01'     -- First date OUTSIDE target range
    GROUP BY  name     -- not TRUNC (load_date, 'MONTH')
    HAVING       COUNT (DISTINCT (TRUNC (load_date, 'MONTH')))     = 2
    ;
    

    Try to keep the columns indexed by themselves in comparisons; in this way, you can use indexes.
    For example, if there is an index on load_date, then the above query could use, as load_date is only on one side of the > = or<>
    A similar State

    where   to_char (load_date, 'FMMonth YYYY') = 'February 2010'
    

    cannot use an index on load_date, because we do not compare load_date - we compare the results of TO_CHAR (load_date,...).

    Published by: Frank Kulash, April 13, 2010 16:44
    Fixed GROUP BY clause

  • SELECT the data inserted into a global temporary Table in a stored proc

    A stored procedure is run from Oracle SQL Developer to insert data into a global temporary table. A SQL (in Oracle SQL Developer) worksheet is open to run a SELECT query to retrieve the data from the temporary table overall which was populated in the stored procedure. No row is returned. I guess it's because the stored procedure and the SELECT statement executed in different sessions.

    Is it possible to run the stored procedure in Oracle SQL Developer and then execute a select statement on the temporary table overall which was filled in the stored procedure by using the same connection so that the data can be extracted?

    I use version 1.5.1 build HAND-5440 of Oracle SQL Developer.

    In a worksheet, do something like

    Start
    insert_proc;
    end;

    Select * from my_temp_table;

    Place the cursor on each statement in turn and Press f9 (where it all began... the end is a single statement.

  • compare the time while ignoring the date

    I have this...

    "In the beach?" is always false no matter what that right now. I guess it's because the date is included in the comparison function.

    I need to compare these time and ignore the date. I can't find a way around it. The time will be the same every day and I would like for them

    to be one of the constants.

    Any help?

    Thank you.

    Try formatting the date in a string that does not include the day (only the hours and minutes).

    Tim W.

    Engineering applications

    National Instruments

    http://www.NI.com/support

  • Select the data in user_cons, user_constraints, user_cons_columns

    Dear Sirs, I want to select the name of the table and its referential tables and constraint_names and column used in this referencial constraints
    I use this selection, but it doesn't look good
    Select t.table_name, t.ref_name, c.constraint_name, m.column_name
    of user_cons t, user_constraints c, user_cons_columns m
    where
    c.table_name = t.table_name
    and m.table_name = c.table_name
    and m.constraint_name = c.constraint_name
    and constraint_type = 'R '.
    and c.table_name like '% STK '.
    order of table_name, constraint_name


    Please help me
    Yasser

    Yasser,

    Try this SQL.

    SELECT A.TABLE_NAME CHILD_TABLE_NAME, D.TABLE_NAME MASTER_TABLE_NAME, A.CONSTRAINT_NAME CHILD_CONSTRAINT_NAME, A.R_CONSTRAINT_NAME MASTER_CONSTRAINT_NAME, C.COLUMN_NAME CHILD_COLUMN, D.COLUMN_NAME MASTER_COLUMN
    FROM USER_CONSTRAINTS A, USER_CONS_COLUMNS C, USER_CONS_COLUMNS D
    WHERE A.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND A.R_CONSTRAINT_NAME = D.CONSTRAINT_NAME AND A.TABLE_NAME LIKE 'STK%'
    ORDER BY A.TABLE_NAME, A.CONSTRAINT_NAME
    

    Kind regards

    Manu.

    If my answer or the answer to another person has been useful or appropriate, please mark accordingly

    Published by: Manu. April 27, 2010 15:19

Maybe you are looking for

  • Want to upgrade 10.10.5 to 11.4

    Have tried several times to download El Capitan from the App store without success. found the download from the drop-down list for 10.11.4 but must run t1o 10.11 use it... have searched but can't seem to find the 10.11

  • New Qosmio G30 hangs after some time by doing nothing about it

    Hello I'm a software engineer. It means that I know only a few things on computers. But this new Qosmio makes me unhappy because I see no chance to let it run stable. I got this phone about 2 weeks. This week * the system crashed about 10 to 15 times

  • DVD drive won't burn CDs?

    I can't copy of CD. I tried to copy an audio CD by using Windows Media Player 10 and Sonic Record now Toshiba, but at the same time produce an error towards the end of the combustion process.I reinstalled the driver DVD and reinstalled Windows Media

  • cannot update Windows XP Pro onlline more

    Working on a project to update Windows XP to Windows Vista, and then to Windows 7 This way users keeping all of their parameters of programs and associated files. When I go on the web site for updates and click on 'EXpress', I get the following" The

  • Select the component much wonder

    I was wondering if there is a component in JDeveloper as the selectManyListBox that allows to display the list in columns instead of just a column?Thank you