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

  • Home
  • SEARCH
  • 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 864169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:25:56+00:00 2026-05-15T09:25:56+00:00

SQL Server 2000. Single table has a list of users that includes a unique

  • 0

SQL Server 2000. Single table has a list of users that includes a unique user ID and a non-unique user name.

I want to search the table and list out any users that share the same non-unique user name. For example, my table looks like this:

ID   User Name   Name
==   =========   ====
0    parker      Peter Parker
1    parker      Mary Jane Parker      
2    heroman     Joseph (Joey) Carter Jones
3    thehulk     Bruce Banner

What I want to do is do a SELECT and have the result set be:

ID   User Name   Name
==   =========   ====
0    parker      Peter Parker
1    parker      Mary Jane Parker   

from my table.

I’m not a T-SQL guru. I can do the basic joins and such, but I’m thinking there must be an elegant way of doing this. Barring elegance, there must be ANY way of doing this.

I appreciate any methods that you can help me with on this topic. Thanks!
—Dan—

  • 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-15T09:25:57+00:00Added an answer on May 15, 2026 at 9:25 am

    One way

    select t1.* from Table t1
    join(
    select username from Table
    group by username
    having count(username) >1) t2 on t1.username = t2.username
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2000 database that will not display the column list
MS SQL Server 2000 I have a column in Table A called Name. I
I have a table in SQL Server 2000 that I am trying to query
Using SQL Server 2000. I have a table that receives a dump from a
In SQL Server 2000 I noticed that the sysbojects exists in each database. Is
Using SQL Server 2000 Table PersonID Date 001 11-02-2009 002 11-02-2009 003 11-02-2009 001
In a legacy database (SQL Server 2000), we have a clustered index that looks
I have a table that I need to normalize with many fields In SQL-Server
I have a stored procedure for SQL Server 2000 that can only have a
SQL Server 2000 I have a table which lists out the months where a

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.