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 8419503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:37:55+00:00 2026-06-10T02:37:55+00:00

I have a SQL Server 2008 table with the following columns: ID = uniqueidentifier

  • 0

I have a SQL Server 2008 table with the following columns:

ID = uniqueidentifier
EntryID = uniqueidentifier
EntryType = nvarchar(128)

In this table some of the rows may have the same EntryType value. What I want to do is run a query that will return me the rows where the EntryType field is unique. The only way I thought of doing this is to group by this field then check for groups with just a single entry. Here is some example data:

11C5AEEB-6435-489D-B353-6E8D63FCD1AD, 46F95579-0AB6-4EAC-927C-7259C2F1E046, Ford
01DBC8EE-78E4-4544-A816-87086BD45DDE, EBB689E3-1379-4E22-98B2-C6BD8EBB0F9D, VW
E948C6D2-0E6E-4AC7-9799-83C5EB180219, 46F95579-0AB6-4EAC-927C-7259C2F1E046, Ford
E70806DC-9D43-4341-AEF8-4252612AF00B, 3A3D2602-DB92-412B-AA4E-8FA70438A00A, Ford
D4460A15-2C4B-475E-B5D9-82C625C10DF7, 3EA31E10-4941-46D3-B241-B091259A2AF4, Lexus

I want to run a stored procedure that when applied to the above data will just return the VW entry as the EntryType column is unique.

  • 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-06-10T02:37:56+00:00Added an answer on June 10, 2026 at 2:37 am
    ;WITH x AS 
    (
      -- first, identify rows where only one EntryType exists:
      SELECT EntryType FROM dbo.table_name
      GROUP BY EntryType HAVING COUNT(*) = 1
    )
    -- now join to that from the main table:
    SELECT t.ID, t.EntryID, t.EntryType
      FROM dbo.table_name AS t
      INNER JOIN x 
      ON x.EntryType = t.EntryType;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SQL Server 2008, I have a table with following columns and data Date
In SQL Server 2008 I have a user table like the following: Userid Username
I have SQL Server 2008 with a table called ProductCategories designed like this: Id
I have a SQL Server 2008 DB with a table like this (Table1): ID
I use SQL Server 2008 and have a table with 5 char typed columns.
I have a SQL Server 2008 database. This database has a Table called Book.
In SQL Server 2008, I have the following tables: CREATE TABLE samples (SampleID int,
I have a following table in SQL Server 2008 database: CREATE TABLE [dbo].[Actions]( [ActionId]
I have a SQL Server 2008 R2 table with the following Schema DECLARE @AttributeTable
Let's say I have the following table in SQL Server 2008: ProfileID int //identity;

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.