Finding First Occurrence in a given year

  • TheSQLGuru (1/3/2017)


    With your requirements amendment I think Drew's modification to my query should get you what you want.

    Actually, it was a modification of my original query. I didn't realize that he wanted counts, so I returned the employees with their first award year. I just wrapped that in a CTE and counted employees by year.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Is there a reason this table would be populated with non-award "events"? In the sample data, employee 1 has 2 nulls and one award. What is the value of those null entries? They are duplicate rows.

    Granted, you are probably getting this data from a larger source that may have these values embedded in it. But it could be profitable to look at the data structures of that source.

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply