• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Query statement to list primary entry only

I am running a  report which has a similar field break down as in the information listed below.  I was wondering if there is a way to list all the schools and the just the first student of each?

Let us a assume the each student is a member of one school for normalization purposes.

School              students
Happy school      June
            Sally
            Bob

Fun School            Harry
            Billy
            Jane

Sad School            Debra
            Alice
            Jack
            Henry
0
drumph
Asked:
drumph
1 Solution
 
dqmqCommented:
Well, you don't say what makes a given student "first" in a school, but if you mean alphabetically, here's one way:


Select School.name, min(StudentName)
from School inner join Student on Student.SchoolID = School.SchoolID
group by School.name
0
 
drumphAuthor Commented:
Found alternate solution
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
which is?
0
 
Vee_ModCommented:
Force accepted.
Vee_Mod
Experts Exchange Moderator
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now