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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:00:56+00:00 2026-05-23T10:00:56+00:00

This seems like it should be easier than I’m finding it. I have a

  • 0

This seems like it should be easier than I’m finding it. I have a table that contains both first and last names (specified by a type ID) and a frequency of how common the name is. For example:

NameType | Name      | FrequencyPercent
1          John        3.267
1          Thomas      1.987
1          Wilson      0.945
2          Smith       4.528
2          Wilson      2.221
2          Thomas      0.437

I want to be able to query out a list of First Names (NameType = 1) that will only include the name if it is more likely to be a First Name than a Last Name (based on the FrequencyPercentage). With this dataset, my FirstNames query would include John and Thomas, and my LastNames query would return Smith and Wilson.

Hopefully I explained that well.

Thanks ahead for a little help,

Russell Schutte

  • 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-23T10:00:56+00:00Added an answer on May 23, 2026 at 10:00 am

    If I understand correctly you’re looking for first names when the frequency is higher than the frequency as same name as last name

    This works for first names. You just need to reverse it for last names

    CREATE Table YourTable
    (
    NameType int,
    name varchar(20),
    FrequencyPercent decimal(12,4)
    )
    
    INSERT INTO  YourTable
    VALUES (1 ,'John', 3.267),
    (1 , 'Thomas',      1.987),
    (1 , 'Wilson',      0.945),
    (2 , 'Smith',       4.528),
    (2 ,  'Wilson',      2.221),
    (2 ,   'Thomas',      0.437)
    
    SELECT firstNames.name
    FROM
          YourTable firstNames 
    LEFT JOIN YourTable  lastNames 
     ON firstnames.Name = lastNames.Name
        AND lastNames.NameType  =2
         and firstnames.FrequencyPercent < lastNames.FrequencyPercent
    WHERE firstNames.NameType  =1
          AND
          lastNames.name is null
    

    results in

    name
    --------------------
    John
    Thomas
    (2 row(s) affected)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody have a slicker way to do this? Seems like it should be easier
This seems like it should be obvious but I can't figure it out. Suppose
This seems like it should be something I already know. We need to run
This seems like it should be something very easy to do, but every time
This seems like it should be an easy thing to do, but for the
This seems like it should be really simple, but I'm unable to figure this
This seems like it should be very easy...anyway, it is in MS SQL Server
This seems like it should be pretty straight forward, but I'm apparently confused. I
Hi this seems like it should work, from something in collectionofsomestuff select new SelectListItem(){Text
It seems like this should be straightforward but I'm boggling. I've got my listview

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.