Results 1 to 4 of 4

Thread: Delete First 3 and Last 3 Rows in Target Table

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Answers
    4

    Delete First 3 and Last 3 Rows in Target Table

    How to delete first 3 rows & last 3 rows in target table in Informatica?
    Please let me know which transformation I should add in mapping?


  2. #2
    Moderator
    Join Date
    Oct 2005
    Answers
    305

    Re: Delete First 3 and Last 3 Rows in Target Table

    You need to make use of sequence generator, rank transformation, nextval port


  3. #3
    Junior Member
    Join Date
    Dec 2011
    Answers
    16

    Re: Delete First 3 and Last 3 Rows in Target Table

    Kindly use below query, it might fullfill the requirement.....

    DELETE FROM EMP_TEMP
    WHERE EMPNO IN (
    SELECT EMPNO
    FROM EMP_TEMP
    WHERE ROWNUM <= 3
    UNION
    SELECT EMPNO
    FROM (SELECT *
    FROM EMP_TEMP
    ORDER BY EMPNO DESC
    )
    WHERE ROWNUM <= 3
    );

    Explanation :
    1. Select stmt. in Blue color will select 1st three row from top.
    2. Select stmt. in green will select employees just in reverse order from which three upper rows will be selected using rownum <= 3
    3. Union of both will pass top three + bottom three employee nos.


  4. #4
    Junior Member
    Join Date
    Sep 2013
    Answers
    1

    Re: Delete First 3 and Last 3 Rows in Target Table

    use Sorter
    use Sequence
    Use filter to remove top 3
    Use sorter
    use Sequence
    Use filter to remove Bottom 3

    you can achieve the same result in multiple ways


  5.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact