Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4604350
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:16:58+00:00 2026-05-22T00:16:58+00:00

I have a sql query as follows: SELECT EVENTTYPEDESCRIPTION, YEAR(EVENTSTARTDATE) as ‘EVENTYEAR’, COUNT(PARTICIPANTID) AS

  • 0

I have a sql query as follows:

    SELECT
        EVENTTYPEDESCRIPTION,
        YEAR(EVENTSTARTDATE) as 'EVENTYEAR',
        COUNT(PARTICIPANTID) AS 'TOTALPARTICIPANTS'
    FROM WEBPROGRAMPARTICIPANTS
    INNER JOIN WEBPROGRAMS
        ON WEBPROGRAMPARTICIPANTS.PROGRAMCODE = WEBPROGRAMS.PROGRAMCODE
    INNER JOIN WEBEVENTS
        ON WEBPROGRAMS.PROGRAMID = WEBEVENTS.EVENTID
    INNER JOIN WEBEVENTTYPEDESCRIPTIONS
        ON WEBEVENTS.EVENTTYPE = WEBEVENTTYPEDESCRIPTIONS.EVENTTYPE
    WHERE WEBPROGRAMPARTICIPANTS.ACCEPTED = 1
    GROUP BY EVENTTYPEDESCRIPTION, YEAR(EVENTSTARTDATE)
    ORDER BY EVENTTYPEDESCRIPTION, YEAR(EVENTSTARTDATE)

Which returns the following results:

EventTypeDescripti  Year    TotalParticipants
Affiliate Workshop  2004    96
Affiliate Workshop  2005    132
Affiliate Workshop  2006    94
Affiliate Workshop  2007    125
Affiliate Workshop  2008    121
Affiliate Workshop  2010    170
Affiliate Workshop  2011    1
IPAM Long Program   2000    59
IPAM Long Program   2001    203
IPAM Long Program   2002    94
IPAM Long Program   2003    182
IPAM Long Program   2004    147
IPAM Long Program   2005    123
IPAM Long Program   2006    99
IPAM Long Program   2007    116
IPAM Long Program   2008    98
IPAM Long Program   2009    127
IPAM Long Program   2010    147
IPAM Long Program   2011    105
IPAM Long Program   2012    14
IPAM Reunion Conference 2002    108
IPAM Reunion Conference 2003    100
IPAM Reunion Conference 2004    98
IPAM Reunion Conference 2005    68

My question is how do I reconstruct the query to show each EventTypeDescription condensed into one line and show each year as a column with its respective count

Example:

Description            Year            Year           etc...
Affiliate Workshop     96              132            ....    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:16:59+00:00Added an answer on May 22, 2026 at 12:16 am

    Thank you all for your efforts. I am going to remember the PIVOT example once our database is upgraded to 2008. For now since we are using SQL Server 2000 I decided to do the pivot within my c# code.

    It is actually better this way forme anyway, since the way Icreaetd it I can pass in any select query result and it will pivot it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a sql query as follows select * from Table where date <
I have a SQL query as follows SELECT * FROM epf_application WHERE application_id IN
I have the a postgre sql query as follows SELECT cNo,max(numLogs),name,surname FROM details GROUP
So I have a SQL Query as Follows SELECT P.Date, P.CategoryName, P.ProductName, SUM(Quantity) Quantity,
i have sql query select * from Roles Join Users On Roles.Role=Users.RoleId it return
Hi all I have a sql query SELECT FKid1, FKID2, a, b, c from
I have a MySQL query as follows: SELECT KeywordText, SUM(Frequency) AS Frequency FROM Keyword,
I have an Entity SQL query: SELECT VALUE t FROM MyEntities AS t WHERE
I have this SQL query: SELECT c.id as ID, c.class_name as CLASS, COUNT(e.student_id) AS
I have a (sql server 2008) query as follows: Select *, column1+column2 as alias1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.