Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2012
    Posts
    4

    Red face Unanswered: Help needed with PLSQL script

    When importing info I get two separate sets of data. One months data gets pulled in with emp no with o's in it and the next month no 0's this creates a duplicate employees. The one thing thats constant is their id no's.

    I need to cleanup the data using a plsql script to join everything from the one table with the other and then deleting the redundant info.

    eg.
    PERID | MINID|MINEMP | MAXID|MAXEMP
    ---------------|----------|----------|----------|---------
    8105105584089 | 585|8970006 | 6825|08970006
    8709270203084 | 594|8960063 | 6834|08960063
    8704150399086 | 599|8947065 | 6839|08947065

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    When importing info I get two separate sets of data
    OK.

    One months data gets pulled in with emp no with o's in it and the next month no 0's this creates a duplicate employees.
    This month: there are "o" (a letter "o") in these data
    Next month: there are "0" (number zero) in these data

    How do they make duplicates? I presume that "this month's o" is, actually, "this month's zero", right?

    The one thing thats constant is their id no's.
    If you say so.

    Your eg. table
    I don't see relation between this table and "sample" data you posted.

    You never mentioned PERID; what are MINID and MINEMP and MAXID and MAXEMP doing here? What do these MIN and MAX mean? I see that MAXEMP = '0' || MINEMP. That would probably be "this month" vs. "next month".

    If that sample table is what you currently have, what would you want to get as a result? Someone smarter than me will probably know what to do, but I don't. Perhaps, if you could provide test case (which includes CREATE TABLE and INSERT INTO several sample records that represent your current situation, as well as required output) it would be easier to assist.

  3. #3
    Join Date
    Jan 2012
    Posts
    4

    plsql

    Thanks for the feedback. Let me try and explain in differently. The data I have has got zero's in the employee no on certain months and no zero's the other.
    Although its the same client because the id no and the other details stays the same the application sees it as two due to the employee no as a user is created on employee no's. The perid is the personal id the max and min id's and emp is the different rowids and employee numbers I get when running a select statement based on personal id's. I need a way to add the maxid to the minid per client and delete the maxid which will be the one with the zero's.

    Hope this will help.

  4. #4
    Join Date
    Jun 2004
    Posts
    796
    Provided Answers: 1
    One months data gets pulled in with emp no with o's in it and the next month no 0's this creates a duplicate employees. The one thing thats constant is their id no's.
    Are you saying that there is one id no per employee? In which case, why are you bothering with emp no? (Or is 'id no' & 'employee no' the same thing?).

    Either way, I'm confused, and I suspect many others are & will remain so until you provide the info requested by Littlefoot.
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •