USP_DATALIST_STUDENT_LASTINITIALS

Returns a list of last initials of students.

Definition

Copy


create procedure dbo.USP_DATALIST_STUDENT_LASTINITIALS
as
    set nocount on;


    select 
        substring(KEYNAME, 1, 1) as LASTINITIAL,
        count(STUDENT.ID) as STUDENTCOUNT
    from dbo.STUDENT
        join dbo.CONSTITUENT on CONSTITUENT.ID = STUDENT.ID
    group by 
        substring(KEYNAME, 1, 1)
    order by 
        LASTINITIAL