locked
Querying a Database for duplicate users RRS feed

  • Question

  • User-1188570427 posted

    How would I query a database to find duplicate users by a user name? Say the user had a name of joe_smith1 and joe_smith2? How would I find that for the whole table?

    Friday, March 15, 2013 1:45 PM

Answers

All replies

  • User-359936451 posted

    These are not duplicates and as such would not be compared or identified as being a duplicate!!!

     

    Friday, March 15, 2013 4:46 PM
  • User-1188570427 posted

    Sorry, maybe I didn't describe it correct. In the system I am working on, joesmith1 and joesmith2 would be duplicate user accounts in the sense of the user's data. Now you're right, their account id's would be seperate. So how can I query a database to find where the username are close?

    Friday, March 15, 2013 9:57 PM
  • User-578610739 posted

    Hi friend,

    just check

    select * from username

    where userid in

    (

    select useid, username from usertable where username = SUBSTR( username, 0 , 5)'

    )

    use substr and instr function to validate same user string and simple check count of it .  pls check this link

    http://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2101.htm

    http://www.techonthenet.com/oracle/functions/substr.php

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 16, 2013 7:33 AM
  • User1428336426 posted

    select * from FeasibilityMaster
    where Feasibility_Id in
    (
    select Feasibility_Id  from FeasibilityMaster where Feasibility_Id like '%Feasi_14032013_1%'
    )

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 16, 2013 7:44 AM