Jim R Posted September 29, 2021 Share Posted September 29, 2021 (edited) 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 September 29, 2021 by Jim R Quote Link to comment Share on other sites More sharing options...
Barand Posted September 29, 2021 Share Posted September 29, 2021 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.