Jump to content

SELECT DISTINCT question...


Jim R

Recommended Posts

In my database, I have multiple entries from people who register to play basketball in an event.  The additional entries are from about a dozen or so people who didn't pay when they initially registered and didn't see the link that takes them directly to pay without registering.

In using SELECT DISTINCT, my minor dilemma is one time they might type in for their school, ex:  Lebanon, the first time, but Lebanon High School the second time.  

Columns:

id | nameFirst | nameLast | school

 

So if this is my query:

select distinct nameFirst,nameLast,school from fallLeague2021 where player_coach ='player'

order by nameLast,nameFirst

...is there a way using SELECT DISTINCT  to just check the first and last names, then going about business as usual on the other columns?

 

it's a minor issue as currently situated, because it's only about 12 or so entries out of 400, but it would nice if there was an elegant solution using SELECT DISTINCT.

Edited by Jim R
Link to comment
Share on other sites

17 minutes ago, Jim R said:

.is there a way using SELECT DISTINCT  to just check the first and last names

You would have to remove "school" from the query. DISTINCT applies to the whole row.

What you are doing also has other problems. You could, say, have two different Bill Smith's signed up. One could even have signed up a second time as William Smith.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.