Jump to content

theINTERN

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by theINTERN

  1. Due to a poor database design, I'm having a dilemma with creating a chart of information on a webpage.  I'm going to try my best to be descriptive as possible.  I have a table that holds information for events that people organize. My primary key is an auto-incremented program ID.  I need to create a page that displays the event holder's name along with the total points they have earned for holding each event, which I would have to do a SUM() for.  An example of the table would look like this, each row divided by a comma: PID, NAME, EVENTNAME, POINTS 1, Alex, Pizza party, 50 2, Alex, Ice cream social, 100 3, Judy, Pizza party, 75 4, Jane, Movie night, 30 I need the webpage to display as follows: Alex, 150 Judy, 75 Jane, 30 The page I need to create needs to list each person in the table along with a total of points that they have earned.  The problem I'm having is only naming Alex once, and adding up his points.  I figured the code snippet would look like something along the lines of: SELECT NAME as name, SUM(POINTS) as points FROM TABLE; Well obviously that won't work because of not being able to distinguish between names and who the points belong to.  So, I'm here to ask anyone if they have a solution to this problem.  I am a beginner when it comes to Oracle SQL and any help would be much appreciated. I am working in ColdFusion. If I haven't been descriptive enough I will do my best to explain.  Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.