Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7697659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:04:03+00:00 2026-05-31T22:04:03+00:00

i need to fine duplicated users in my USERS table and insert to different

  • 0

i need to fine duplicated users in my USERS table and insert to different table the user_id and the duplicated user_id.
I build this script and i don’t know what’s wrong in it.

BEGIN
FOR  v_user IN ( 
                  SELECT u.*
                  FROM users u
                  )
loop
       FOR v_dupUser IN (
                           SELECT u.*
                           FROM users u
                           WHERE u.email = v_user.email
                                 OR u.mobile_phone = v_user.mobile_phone
                                 OR u.land_line_phone = v_user.mobile_phone
                           )
       loop
           INSERT INTO DUPLICATES_USERS(id, user_id, dup_user_id,time_created) 
           VALUE (SEQ_DUPLICATED_USERS, v_user.id, v_DupUser,SYSDATE);
       end loop;
end loop;
END;

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:04:04+00:00Added an answer on May 31, 2026 at 10:04 pm

    I would be more including to go down a path like this;

    insert into duplicated_users
     (select a.user_id user_id,
     b.user_id dup_user_id
     from users a
      , users b
     where (a.email = b_user.email
       OR a.mobile_phone = b_user.mobile_phone
       OR a.land_line_phone = b_user.mobile_phone)
      and a.user_id != b.user_id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The value of ig is being transfered fine, but I need to put this
I need to implement fine-grained access control in a Ruby on Rails app. The
I need to compair current time with two time rang, its work fine in
I need to upload a csv file to a server. works fine for smaller
I define some Entities which works fine; for meta programming issues. I now need
I've developed a web application that worked fine in JBoss 4. Now, I need
Possible Duplicate: Why doesn't scanf need an ampersand for strings and also works fine
i need to show pages'details , now i used this query to fetch from
I need to store data related to items where there will be various different
I need SQL code that will identify possible duplicates in a table. Lets say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.