How to eliminate duplicates in this table

SELECT sti.item,
MI: ITEM_DESC,
Count (STI. Item) item_count,.
d.dept_name,
d.group_no,
d.BUD_INT,
STI.standard_unit_retail,
ISC.unit_cost,
margin (sti.standard_unit_retail - isc.unit_cost).
Count (STI. Item) *(STI.standard_unit_retail-ISC.unit_cost) total_amount,.
County (sti.item) * isc.unit_cost Tot_Sales,.
STH. TRAN_DATETIME
Of
sa_tran_item sti,
item_supp_country Sai,
IM item_master,
STARTING d,
sth sa_tran_head
WHERE
STI. Item = isc.item
and sti.item = im.item
and d.DEPT = sti. DEPT
and sth. TRAN_SEQ_NO = sti. TRAN_SEQ_NO
and sth. TRAN_DATETIME between: p1 and: p2
Group of sti.item, im. ITEM_DESC, d.dept_name, d.group_no, d.BUD_INT, sti.standard_unit_retail, isc.unit_cost)
STI.standard_unit_retail - isc.unit_cost), STH. TRAN_DATETIME

When I combine this STH. TRAN_DATETIME I have some duplicate values in STH. TRAN_DATETIME repeated dates... How to avoid duplicates and at the same time the group the STH. TRAN_DATETIME...
Please help... urgent

Hello

If you mean that you must get rid of time, then you can put TRUNC around STH. TRAN_DATETIME:

 SELECT sti.item,
im.ITEM_DESC,
COUNT(sti.item) item_count,
d.dept_name,
d.group_no,
d.BUD_INT,
sti.standard_unit_retail,
isc.unit_cost,
( sti.standard_unit_retail-isc.unit_cost ) margin,
count(sti.item)*(sti.standard_unit_retail-isc.unit_cost) total_amount,
count(sti.item)*isc.unit_cost Tot_Sales,
trunc(sth.tran_datetime) TRAN_DATETIME
FROM
sa_tran_item sti,
item_supp_country isc,
item_master im,
deps d,
sa_tran_head sth
WHERE
sti.item = isc.item
and sti.item=im.item
and d.DEPT=sti.DEPT
and sth.TRAN_SEQ_NO = sti.TRAN_SEQ_NO
and sth.TRAN_DATETIME between :p1 and :p2
group by sti.item, im.ITEM_DESC, d.dept_name, d.group_no, d.BUD_INT, sti.standard_unit_retail, isc.unit_cost, (
sti.standard_unit_retail-isc.unit_cost ), trunc(STH.TRAN_DATETIME)

Herald tiomela
http://htendam.WordPress.com

Tags: Database

Similar Questions

  • JS: How to remove duplicates in a table?

    JS: How to remove duplicates in a table?

    I guess there's a simple solution...

    Hey!

    Maybe something like this:

    Array.prototype.unique = function (){
        var r = new Array();
        o:for(var i = 0, n = this.length; i < n; i++){
            for(var x = 0, y = r.length; x < y; x++){
                if(r[x]==this[i]) continue o;}
            r[r.length] = this[i];}
        return r;
    }
    

    Use:

    var myArray = ["a","b","c","c","a","d","b","b"];
    alert(myArray.unique());
    

    Hope that helps.

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • How to eliminate duplicates in the playlists.

    Sometimes I drag an album to a playlist... create duplicate songs.  How can I easily identify.  Or maybe avoid - like iTunes will ask if you want copy duplicates

    Hi vbjnk,

    (a) are you referring to Windows Media Player? I would like to know if it is something else

    (b) this only happens with a particular album?

    I suggest you try the following steps:

     

    Step 1: Check the location of the file and delete the duplicate entry

     

    1. read the album; Right click on the item\file double and select Properties

    2. check the location of the file and you can remove the copy element

    The player is followed by a file and replace your library entries that point to files in this folder. For example, you might have copied the files into a new folder but does not delete the original files in the folder in question.

    To prevent the entries again added to your library

    1.

    Delete or move the files in the folder in question

    The monitor records is useful for automatically updating your library when the controlled media digital media files information. However, you must be careful to keep the list of files controlled by the player to date to avoid invalid entries in your library.

    For more information on the tracking folder, please see the link below

    Add items to the Windows Media Player library

    http://Windows.Microsoft.com/en-us/Windows-Vista/add-items-to-the-Windows-Media-Player-library

    If the problem occurs because several albums try step 2

    Step 2: You can rebuild the Player Windows Media database library. To do this, follow the steps mentioned in the link below

    You cannot view, add, or delete items in the library of Windows Media Player 11

    http://support.Microsoft.com/kb/925718

    Step 3: Stop the entries in double or invalid to be added to my library when I play the music files

    When you move digital media files on your computer, the file name and file path information remain unchanged in your library. Then when you select a file to play to its new location, a new entry is created in your library if you select the option automatically added to your library when played. As a result, your library can quickly contain a large number of entries, duplicate or invalid.

    To prevent it be automatically added to your library of music files

    1.

    In Windows Media Player, on theTools menu, clickOptions.

    2.

    On the Player tab, clear the checkbox Add music files to library when played .

       
       

    Note: Now, when you play music on your computer or the Internet, the file will not be added automatically to your library.

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to remove duplicates from a Table using PL/SQL

    I created the following tables with data:

    * Table 1: *.



    Department of CREATE TABLE

    (DEPARTMENT_ID 4 NUMBER PRIMARY KEY,

    DEPARTMENT_NAME VARCHAR2 (20).

    ADDRESS VARCHAR2 (20));







    INSERT INTO Department VALUES (10, 'ACCOUNTING', 'NEW YORK');

    INSERT INTO Department VALUES (20, "SEARCH", "DALLAS");

    INSERT INTO Department VALUES (30, 'SALES', 'CHICAGO');

    INSERT INTO Department VALUES (40, 'OPERATIONS', 'BOSTON');

    COMMIT;



    * 2nd table: *.

    CREATE TABLE employee

    (EMPLOYEE_ID NUMBER 4 PRIMARY KEY,

    EMPLOYEE_NAME VARCHAR2 (20).

    USE VARCHAR2 (20).

    MANAGER_ID NUMBER 4,

    HIRE_DATE DATE,

    NUMBER OF SALARY (9, 2)

    COMMISSION (9, 2) NUMBER,

    Department_id number 4 REFERENCES department (DEPARTMENT_ID));






    INSERT INTO employee

    VALUES (7839, 'KING', 'PRESIDENT', NULL, NOVEMBER 17, 81 ', 5000, NULL, 10);

    INSERT INTO employee

    VALUES (7698, "BLAKE", "MANAGER", 7839, MAY 1, 81 ', 2850, NULL, 30);

    INSERT INTO employee

    VALUES (7782, "CLARK", "MANAGER", 7839, JUNE 9, 81 ', 2450, NULL, 10);

    INSERT INTO employee

    VALUES (7566, "JONES", "MANAGER", 7839, APRIL 2, 81 ', 2975, NULL, 20);

    INSERT INTO employee

    VALUES (7654, 'MARTIN', 'SELLER', 7698, 28-SEP-81', 1250, 1400, 30);

    INSERT INTO employee

    VALUES (7499, 'ALLEN', 'SELLER', 7698, FEBRUARY 20, 81 ', 1600, 300, 30);

    INSERT INTO employee

    VALUES (7844, 'TURNER', 'SELLER', 7698, ' 08-SEP-81', 1500, NULL, 30);

    INSERT INTO employee

    VALUES (7900, 'JAMES', 'CLERKS', 7698, 3 DECEMBER 81', 950, NULL, 30);

    INSERT INTO employee

    VALUES (7521, 'WARD', 'SELLER', 7698, FEBRUARY 22, 81 ', 1 250, 500, 30);

    INSERT INTO employee

    VALUES (7902, "FORD", "ANALYST", 7566, DECEMBER 3, 81 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7369, 'SMITH', 'CLERKS', 7902, DECEMBER 17, 81 ', 800, NULL, 20);

    INSERT INTO employee

    VALUES (7788, 'SCOTT', 'ANALYST', 7566, DECEMBER 9, 82 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7876, ' ADAMS, "CLERK", 7788, 12 JANUARY, 83', 1100, NULL, 20);

    INSERT INTO employee

    VALUES (7934, 'MILLER', 'CLERKS', 7782, JANUARY 22, 82 ', 1300, NULL, 10);

    COMMIT;



    I need to print all Department names, employee and salary. I did this, but how can display the name of each Department only once?





    Here is my code:



    DECLARE

    v_department_name department.department_name%TYPE;

    v_employee_name employee.employee_name%TYPE;

    v_salary employee.salary%TYPE;

    CURSOR dept_cur

    IS

    SELECT employee_name, department_name, Department OF employee salary

    WHERE department.department_id = employee.department_id (+)

    ORDER BY department_name, employee_name;

    BEGIN

    OPEN dept_cur.

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    DBMS_OUTPUT. PUT_LINE ('DEPARTMENT_NAME EMPLOYEE_NAME WAGES');

    DBMS_OUTPUT. PUT_LINE('---------------------------------------------------');

    While dept_cur % FOUND

    LOOP

    DBMS_OUTPUT. Put_line (RPAD (v_department_name, 10) |) ' ' || RPAD (v_employee_name, 10). ' ' || v_salary);

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    END LOOP;

    CLOSE Dept_cur;

    END;

    I would appreciate if you could help me with this. I'm sure it's a quick and easy answer, but I can't do it. I spent so much time already.

    Published by: 831522 on January 26, 2011 11:44

    It is a problem of display/reports rather than a problem of duplication of query data. The answer depends on what tools you use to query and display the data. You can use the clause "break it" I suggested earlier if you use SQL Plus.

    Otherwise, you can try this based on the version of Oracle you are using. Someone else may be able to get the data in a single pass.

    SELECT decode(emp_id, 1, department_name) department_name, employee_name, salary
    FROM(SELECT department_name, employee_name, salary,
           ROW_NUMBER() OVER (PARTITION BY department_name order by department_name, employee_name) AS emp_id
         FROM department
         LEFT OUTER JOIN employee ON (department.department_id = employee.department_id)
    ORDER BY department_name, employee_name, emp_id);
    
  • HOW TO ELIMINATE DUPLICATES IN THE GIVEN REPORT.

    How can I avoid double counting (* TOTAL_COUNT = 3 or 2 *) so I have to take a record only. How can I change the following query

    SQL > SELECT * FROM V$ VERSION;

    BANNER
    ---------------------------------------------------------------
    Oracle Database 10g Release 10.2.0.3.0 - Production
    PL/SQL version 10.2.0.3.0 - Production
    CORE Production 10.2.0.3.0
    AMT for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production



    1 EMPNO, COUNT (*) SELECT TOTAL_COUNT, SUM (CASE WHEN E.DEPTNO = 1 THEN 20 0) OTHERWISE END DEPT_20_COUNT.
    2 SUM (CASE WHEN E.DEPTNO = 1 THEN 30 0) OTHERWISE END DEPT_THIRTY_COUNT.
    3 SUM (CASE WHEN E.DEPTNO = 1 THEN 10 0) OTHERWISE END DEPT_TEN_COUNT
    4. OF EMP_TEST E, DEPT. D WHERE E.DEPTNO = D.DEPTNO
    5 * GROUP BY EMPNO
    SQL > /.

    EMPNO TOTAL_COUNT DEPT_20_COUNT DEPT_THIRTY_COUNT DEPT_TEN_COUNT
    ----- ----------- ------------- ----------------- --------------
    7782 1 0 0 1
    7839 1 0 0 1
    7844 1 0 1 0
    7698 1 0 1 0
    7521 1 0 1 0
    7902 1 1 0 0
    7566 1 1 0 0
    7654 1 0 1 0
    7788 1 1 0 0
    7934 1 0 0 1
    * 7499 3 0 3 0 *.
    7876 1 1 0 0
    * 7369 2 2 0 0 *.
    7900 1 0 1 0

    Insert the script:
    -------------
    TOGETHER TO DEFINE
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7369, 'SMITH', 'CLERKS', 7902, TO_DATE (DECEMBER 17, 1980 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    800, NULL, 20);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7499, "ALLEN", "SELLER", 7698, TO_DATE (FEBRUARY 20, 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    1600, 300, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7521, 'WARD', 'SELLER', 7698, TO_DATE (FEBRUARY 22, 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    1250, 500, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7566, 'JONES', 'MANAGER', 7839, TO_DATE (APRIL 2, 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    2975, NULL, 20);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7654, 'MARTIN', 'SELLER', 7698, TO_DATE (28 SEPTEMBER 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    1250, 1400, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE (1 MAY 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    2850, NULL, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7782, 'CLARK', 'MANAGER', 7839, TO_DATE (9 JUNE 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    2450, NULL, 10);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE (9 DECEMBER 1982 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'),)
    3000, NULL, 20);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7839, 'KING', 'PRESIDENT', NULL, TO_DATE (17 NOVEMBER 1981 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'),)
    5000, NULL, 10);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7844, 'TURNER', 'SELLER', 7698, TO_DATE (8 SEPTEMBER 1981 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'),)
    1500, 0, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7876, 'ADAMS', 'CLERKS', TO_DATE 7788 (12 JANUARY 1983 00:00:00 ", ' MM/DD/YYYY HH24:MI:SS'"),)
    1100, NULL, 20);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7900, 'JAMES', 'CLERKS', 7698, TO_DATE (3 DECEMBER 1981 00:00:00 ", ' MM/DD/YYYY HH24:MI:SS'"),)
    950, NULL, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7902, "FORD", "ANALYST", 7566, TO_DATE (3 DECEMBER 1981 00:00:00 ", ' MM/DD/YYYY HH24:MI:SS'"),)
    3000, NULL, 20);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7934, 'MILLER', 'CLERKS', 7782, TO_DATE (23 JANUARY 1982 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    1300, NULL, 10);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7369, 'SMITH', 'CLERKS', 7902, TO_DATE (DECEMBER 17, 1980 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    800, NULL, 20);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7499, "ALLEN", "SELLER", 7698, TO_DATE (FEBRUARY 20, 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    1600, 300, 30);
    Insert in the TEST. EMP_TEST
    (BISHOP, EMPLOYMENT ENAME, EMPNO, HIREDATE,
    SAL, COMM, DEPTNO)
    Values
    (7499, "ALLEN", "SELLER", 7698, TO_DATE (FEBRUARY 20, 1981 00:00:00 "," MM/DD/YYYY HH24:MI:SS'),)
    1600, 300, 30);
    COMMIT;

    try this one,

        SELECT EMPNO,COUNT(*) TOTAL_COUNT,SUM(CASE WHEN E.DEPTNO=20 THEN 1 ELSE 0 END) DEPT_20_COUNT,
                   SUM(CASE WHEN E.DEPTNO=30 THEN 1 ELSE 0 END) DEPT_THIRTY_COUNT,
                   SUM(CASE WHEN E.DEPTNO=10 THEN 1 ELSE 0 END) DEPT_TEN_COUNT
           from (SELECT EMPNO,DEPTNO,row_number() over(PARTITION BY EMPNO ORDER BY EMPNO) rn
                    FROM EMP_TEST e,departments D WHERE E.DEPTNO=D.DEPartment_id) e
         where rn = 1
         GROUP BY EMPNO;
      
    
  • How to find duplicates in the table

    I have a table with 3 columns

    name of the table - used

    empcode firstname lastname
    XYZ 123 pk
    yzz 456 pk
    101 kkk jk


    ALTER TABLE employee
    ADD (CONSTRAINT PRIMARY KEY employee_PK
    (empcode, firstname, lastname))


    all the three columns are as key to porimary, we are migrating the data, there are problems with the data as the cobination of all three, resulting in duplicate, in the last column is supposed to be duplicates but first two columns will not have the duplicate and a complete line of the table (combination have no duplicates)

    a query need to find duplicates to validate the whole lines

    (B-)

    select empcode,firstname,lastname,count(*)
    from employee
    group by empcode,firstname,lastname
    having count(*)>1;
    
  • How to eliminate extra space inside tables

    Strangely enough, IE doesn't add the extra space between the top of my bar of navigation and the inside of the top border. However, in Safari and Firefox, the navigation bar everything moving several pixels.

    http://www.bhs78reunion.com/fun.html

    Thank you in advance for help a beginner!

    You have an error in your code

    Change this:


    cellspacing = "0" id = "tableLayout" >

    to do this:


    cellspacing = "0" id = "tableLayout" >

    See if it helps

    --
    JO

    "juliepb59" wrote in message
    News:g3pj2f$7l2$1@forums. Macromedia.com...
    > Oddly, IE doesn't add the extra space between the top
    > of my
    > bar navigation and the inside of the top border. However, in Safari and
    > Firefox
    > the entire navigation bar moves down several pixels.
    >
    > http://www.bhs78reunion.com/fun.html
    >
    > Thank you in advance for help a beginner!
    >

  • How to join this per_rating_levels this table with query table.

    Dear all,

    Guide how 2 join me per_rating_levels this table with query because, I want 2 see the per_rating_levels.name against all employees.
    When I join this table with query it shows several recording/cortion against this record.

    Query:

    SELECT
    PAPF.full_name employee_name,
    papf1.full_name supervisor_name,
    WOMEN'S WEAR. Employee_number,

    hr_general.decode_job (PAAF.job_id) job_name,
    Department of hr_general.decode_organization (PAAF.organization_id),
    PC.Name, PCE.Comments EmployeeComments,
    (by selecting pce1.comments in per_competence_elements pce1
    where
    PCE.assessment_id = pce1.assessment_id
    AND pce.competence_id = pce1.competence_id
    AND pce1.object_id = pce.object_id) ManagerComments;

    --(sélectionnez rtl.name dans rtl où les pc.) RATING_SCALE_ID = rtl. Name RATING_SCALE_ID)


    OF per_all_people_f women's wear.
    per_all_people_f papf1,
    per_all_assignments_f ADP,
    PA per_appraisals,
    pat per_appraisal_templates,
    per_assessments not,
    per_competence_elements pce,
    per_competences pc


    WHERE papf.person_id = paaf.person_id
    AND paaf.supervisor_id = papf1.person_id
    AND paaf.primary_flag = 'Y '.
    AND pa.appraisee_person_id = papf.person_id
    AND pa.appraisal_template_id = pat.appraisal_template_id
    AND pa.appraisal_id = pas.appraisal_id
    AND pat.assessment_type_id = pas.assessment_type_id
    AND pas.assessment_id = pce.assessment_id
    AND pce.object_id = papf.person_id
    AND pce.competence_id = pc.competence_id
    AND trunc (sysdate) BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND trunc (sysdate) BETWEEN papf1.effective_start_date AND papf1.effective_end_date
    AND trunc (sysdate) BETWEEN paaf.effective_start_date AND paaf.effective_end_date

    - AND papf.employee_number =: p_employee_number
    - AND pa.appraisal_date =: p_appraisal_date
    - AND papf.business_group_id =: p_bg_id

    order of papf.employee_number


    Concerning

    user10941925 wrote:
    Dear all,

    Guide how 2 join me per_rating_levels this table with query because, I want 2 see the per_rating_levels.name against all employees.
    When I join this table with query it shows several recording/cortion against this record.

    '2' in your question means "to"? If so please do not use text instant message in this forum.

    Now I suppose that PRE_RATING_LEVELS is a table in your application. And you are trying to include this table in an existing query. But in doing so, you have found the Cartesian product, correct?

    In fact, how do you think someone a public forum without any knowledge of your table and data structure could help you?

    Lets see, here's your query. I formatted.

    
    select papf.full_name                                       employee_name
         , papf1.full_name                                      supervisor_name
         , papf.employee_number                                 employee_number
         , hr_general.decode_job(paaf.job_id)                   job_name
         , hr_general.decode_organization(paaf.organization_id) department
         , pc.name                                              name
         , pce.comments                                         employeecomments
         , (
              select pce1.comments
                from per_competence_elements pce1
               where pce.assessment_id = pce1.assessment_id
                 and pce.competence_id = pce1.competence_id
                 and pce1.object_id = pce.object_id
           )                                                    managercomments
      from per_all_people_f        papf
         , per_all_people_f        papf1
         , per_all_assignments_f   paaf
         , per_appraisals          pa
         , per_appraisal_templates pat
         , per_assessments         pas
         , per_competence_elements pce
         , per_competences         pc
     where papf.person_id           = paaf.person_id
       and paaf.supervisor_id       = papf1.person_id
       and paaf.primary_flag        = 'Y'
       and pa.appraisee_person_id   = papf.person_id
       and pa.appraisal_template_id = pat.appraisal_template_id
       and pa.appraisal_id          = pas.appraisal_id
       and pat.assessment_type_id   = pas.assessment_type_id
       and pas.assessment_id        = pce.assessment_id
       and pce.object_id            = papf.person_id
       and pce.competence_id        = pc.competence_id
       and trunc(sysdate) between papf.effective_start_date  and papf.effective_end_date
       and trunc(sysdate) between papf1.effective_start_date and papf1.effective_end_date
       and trunc(sysdate) between paaf.effective_start_date  and paaf.effective_end_date
    order
        by papf.employee_number 
    

    Now, you want to add the PRE_RATING_LEVELS in the list so that you can use the column NAME.

    First thing you need to do is to determine the relationship between PRE_RATING_LEVELS and other tables. A relationship can be

    1. one on one
    2 one-to-many
    3. - to-several

    So when you tried to join, your state of health has resulted in 2nd or 3rd type of relationship. If you arrive with someone who knows the business and the data and find the table that could uniquely identify a line of PRE_RATING_LEVELS.

  • No idea what this area of research and how to eliminate it?

    When I do a search using Google search, a tan window appears above the search results and in the text window and search options/tools.
    How to eliminate it from appearing in my browser search result, when you use Google search?

    The links within this tan window redirect me to sites such as:
    http://www.ideasgames.com/search/?q=search & Submit.x = 1238 & Submit.y =-68
    or
    Google - co.com

    Source code for the above link:

    < title > connection... < /title >
    < content meta = text/html"; charset = utf-8 "http-equiv ="Content-Type">"
    < script language = "Javascript" type = "text/javascript" >
    function zzzz() {}
    document. CCBC. Submit();
    }
    < /script >

    < do action = "" / adv/go / ' method = 'get' name = "cccc" > "

    < / make >

    check in SafeMode fireefox

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

  • I have a spam in my email MSN that sends messages to all of my contacts in my address book. No idea how to eliminate this problem. Thank you!

    I have a spam in my email MSN that sends messages to all of my contacts in my address book. Emails to all of my contacts in my address book. The emails are added to viagra and * with links on how order cheap products. No idea how to eliminate this problem. I have Microsoft Essentials and performed a full scan with clear results. The issue is my e-mail account. Thank you!

    Support MSN:
    http://support.Microsoft.com/kb/940784

  • How can fill us with data in this table AR_RECEIVABLE_APPLICATIONS_ALL

    Hi all

    How can fill us the data in this table, I created a credit memo and marked it complete but I'm still not able to get the data in this table.

    What is the correct approach or any other alternative available.

    Thank you
    Ajay

    Hello.

    Ok. In the Menu, choose Actions and Applications.

    Octavio

  • To delete all tables in TT, how can I use cursor this way Timesten 11?

    Hello
    I want to delete all tables in Timesten, so I create a procedure like this, but it seems does not work correctly.

    It seems cursor in not accurate Timesten with which in ORACLE. So we are looking for alternatives to do. Could you please provide your expert voice on it.

    Thank you very much.

    Like the following:


    Command > create or replace procedure dropAllTables
    > as
    > CURSOR mycursor IS select table_name from user_tables;
    > table_name user_tables.table_name%type;
    > dropSql varchar2 (200);
    > start
    > Open mycursor;
    > fetch mycursor into table_name;
    > while mycursor found %
    > loop
    > dropSql: = 'drop table ' | table_name;
    > immediately execute dropSql;
    > fetch mycursor into table_name;
    > end of loop;
    > close mycursor;
    > end;
    > /.

    Created procedure.

    Command > exec dropAllTables;


    8507: ORA-01001: Invalid cursor
    8507: ORA-06512: at "TT. DROPALLTABLES', line 13
    8507: ORA-06512: at line 1
    The command failed.



    How can I use cursor this way Timesten 11?

    It is the implementation of cursor close commit on in Timesten is the cause.

    As the drop statements are internally auto-valider the transaction so it closes the cursor itself. So when the next time that you attempt to extract it is your "error cursor not valid."

    Can you try this instead

    create or replace procedure dropAllTables
    as
    CURSOR mycursor IS select table_name from user_tables;
    table-name user_tables.table_name%type;
    type t_row_collection is table of the directory index user_tables.table_name%type;
    t_rows t_row_collection;
    dropSql varchar2 (200);
    Start
    Open mycursor;
    Mycursor fetch bulk collect into t_rows;
    Close mycursor;
    j in t_rows.first... loop t_rows. Last
    dropSql: = 'drop table ' | t_rows (j);
    immediately run dropSql;
    end loop;
    end;

  • How to delete records from a table that has a composite unique key duplicate

    Hello
    I get the customer data from various sources in the staging of the table where I insert in the database table where the combination of two columns is considered as a unique key. But there is a possibility of duplicates. How to find duplicates in a SQL or pl/sql

    Thank you
    Manoi.

    Kassa,

    You can see the duplicates by using the following query...

    sql> select * from temp_rajesh;
    
          COL1       COL2 MESSAGE
    ---------- ---------- ------------------
           100        200 message
           100        200 message2
           300        400 message3
           400        500 message 4
    
    sql> select col1, col2, count(*)
      2     from temp_rajesh
      3       group by col1, col2
      4         having count(*) > 1;
    
          COL1       COL2   COUNT(*)
    ---------- ---------- ----------
           100        200          2
    

    -If in the case of duplicate records, you should see only the duplicates (according to some timestamp etc., you can use the functinon row_number analytic..)

      1  select col1, col2 from (
      2  select col1, col2,
      3         row_number() over (partition by col1, col2
      4                            order by message) rn
      5    from temp_rajesh)
      6*   where rn > 1
    sql> /
    
          COL1       COL2
    ---------- ----------
           100        200
    

    In the above example, I use message to order, you can replace it with activity_timestamp or the insertd_date according to your logic... when there are two records... one that you choose to duplicate.

    Thank you
    Rajesh.

    Published by: Rajesh Chamarthi on November 20, 2009 12:05 AM (added for example)

  • How to remove duplicates from the PL - SQL table?

    Hi gurus,

    I have a PL - SQL table with the following structure
    Authors (SR_NO, Auth_Code, Change_Date, cost)

    This table is filled using a slider. However, this table can have a few lines in double (for column (Auth_Code)
    for example
    SR_NO      Auth_Code       Change_Date                       Cost
    1               A1             14-FEB-09 08.18.47 AM          11.00
    2               A2             14-FEB-09 08.18.56 AM       2839.00
    3               A1             15-FEB-09 08.00.02 AM      1299.00
    4               A1             15-FEB-09 07.00.00 AM        789.00
    5               A3             14-FEB-09 08.18.56 AM        312.00
    6               A4             14-FEB-09 08.19.02 AM        233.00
    I need to get the above result set select the separate lines of Auth_Code including the Change_Date is maximum (and store in another PL - SQL table for treatment later or even the removal of this table will be also!)

    of the data A1 is duplicated and a maximum Change_Date above = 15 February 09 08.00.02 AM.
    Where my PL - SQL Table that results must have given below
    SR_NO      Auth_Code       Change_Date                       Cost
    2               A2             14-FEB-09 08.18.56 AM       2839.00
    3               A1             15-FEB-09 08.00.02 AM      1299.00
    5               A3             14-FEB-09 08.18.56 AM        312.00
    6               A4             14-FEB-09 08.19.02 AM        233.00
    I'm not very aware of the PL - SQL tables and there is no chance to change the existing cursor that fills the data in this table PL - SQL.
    I guess that I need to compare each record of PL - SQL table with others, but do not know how to do this.

    Could you please help?

    Hello

    Like this?:

    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    
    SQL>
    SQL> with data as(
      2  select 1 as SR_NO, 'A1' as Auth_Code, to_date('14-FEB-09 08.18.47', 'dd-mon-yy hh24:mi:ss') as change_date,    11.00 as cost from dual union all
      3  select 2 as SR_NO, 'A2' as Auth_Code, to_date('14-FEB-09 08.18.56', 'dd-mon-yy hh24:mi:ss') as change_date,  2839.00 as cost from dual union all
      4  select 3 as SR_NO, 'A1' as Auth_Code, to_date('15-FEB-09 08.00.02', 'dd-mon-yy hh24:mi:ss') as change_date,  1299.00 as cost from dual union all
      5  select 4 as SR_NO, 'A1' as Auth_Code, to_date('15-FEB-09 07.00.00', 'dd-mon-yy hh24:mi:ss') as change_date,   789.00 as cost from dual union all
      6  select 5 as SR_NO, 'A3' as Auth_Code, to_date('14-FEB-09 08.18.56', 'dd-mon-yy hh24:mi:ss') as change_date,   312.00 as cost from dual union all
      7  select 6 as SR_NO, 'A4' as Auth_Code, to_date('14-FEB-09 08.19.02', 'dd-mon-yy hh24:mi:ss') as change_date,   233.00 as cost from dual)
      8  select * from data d where change_date = (select max(change_date) from data d2 where d.auth_code = d2.auth_code);
    
         SR_NO AUTH_CODE CHANGE_DATE       COST
    ---------- --------- ----------- ----------
             2 A2        14/02/2009        2839
             3 A1        15/02/2009        1299
             5 A3        14/02/2009         312
             6 A4        14/02/2009         233
    
    SQL>
    

    Kind regards

  • Windows Photo Gallery - how to prevent duplicates to be downloaded from my camera?

    How to stop being transferred from camera duplicates?

    Hello

    1. have you made changes on the computer before this problem?

    2 are you facing this problem during the download of the image on the site?

    3. which site you are trying to download photos?

    If you have duplicates on the system when copying photos using the camera then I suggest you to read the following article.

    Eliminate duplicate files: http://windows.microsoft.com/en-US/windows-vista/Eliminate-duplicate-files

Maybe you are looking for

  • Recovery disk dv6-2155dx

    IM tryin to order my restore disk I called hp, they told me that I have to order online, I can't seem to find my operating system is winddows 7 64 bit is their something I can do... btw is my serial number: CNF012CS9J

  • How can I find the 'hidden' files that take more than 300 GB of space?

    "Get info" shows that I have close to 500 concerts in my user folder, but when I add each folder inside, it is only about 100 GB.  Where could hide these other files?  My garbage can is completely empty and I ran check disk on this drive and it shows

  • Satellite A300-17N where is the reset button

    Hello I have laptop toshiba A300 17N but, I can't find the reset button on it? :) if anyone knows... Please help me...:) Thank you..

  • Divide a fall of 13-m111sa WiFi connection

    Hello Forum, I hope you can help us here. My daughter has an HP Split 13-m111sa x 2 notebook/tablet. She got in March of this year, he is running Win OS 8.1 with applied updates. The problem or symptoms are:-WiFi connection that it uses both at home

  • ENVY dv7 - 7389ca: driver missing ACPI\HPQ0004\2 &amp; DABA3FF &amp; 2

    Hello world Just updated my dv7 - 7389ca to 8.1 company DESIRE. Miss me a diver, under other devices in Device Manager / unknown device Description ACPI\HPQ0004\2 & DABA3FF & 2 Thanks in advance for the help.