Need to select two distinct columns in my recordset

I have one table named AttendanceGrid:

Here are an example of the data and column names

Name   Activity   Start          Stop       Month      Notes

Bobby      Tennis    12:00pm   2:00pm   January     None
Timmy     Tennis    12:00pm   2:00pm   February     None
Joyce        Tennis    1:00pm    3:00pm    February     None
Dennis     Tennis    12:00pm   2:00pm   January     None
Sue          Tennis    1:00pm     3:00pm   January     None
Bart         Soccer   12:00pm   2:00pm   January     None

I would like to select Distinct Activity records associated with the Start and Stop Time.  For example if I selected distinct Activity associated with Start and Stop times I should be able to pull up the following:

Tennis   12:00pm  2:00pm
Tennis   1:00pm    3:00pm
Soccer   12:00pm   2:00pm

How can I write an SQL statement to do that?  I am quite novice to SQL code
al4629740Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
nishant joshiConnect With a Mentor Technology Development ConsultantCommented:
select  Activity,MAX(Start),MAX(Stop) from tbl group by Activity

Open in new window

0
 
wdosanjosConnect With a Mentor Commented:
Perhaps:
select distinct Activity, Start, Stop
  from AttendanceGrid

Open in new window

0
 
al4629740Author Commented:
What does the Max in  MAX(Start) mean?
0
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

 
nishant joshiTechnology Development ConsultantCommented:
max which is an aggregate function.
0
 
al4629740Author Commented:
what does it do?
0
 
Anthony PerkinsConnect With a Mentor Commented:
Here is what SQL Server's BOL states about MAX():

Returns the maximum value in the expression.
...
For character columns, MAX finds the highest value in the collating sequence.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.