Jump to content

Search the Community

Showing results for tags 'group'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I have data Name, Year, Month, Amount == A, 2012, nov, 14 A, 2012, dec, 48 A, 2012, jan, 8 B, 2011, feb, 17 B, 2011, aug, 10 (...) How is it possible to group the names, so the output will be Name, Feb2011, Aug2011, Jan2012, Nov2012, Dec2012 == A, 0, 0, 8, 14, 48 B, 17, 10, 0, 0, 0 I have really no idea what function to look for.
  2. Heya I've been having a hard time getting my mysql query to do as I want. SELECT m.team, SUM(pc.points) AS total_points FROM members AS m JOIN pointscount AS pc ON pc.tournamentid = m.tournament JOIN persons AS p ON p.pid = m.person WHERE p.secret = 1 AND m.tournament = 5 AND pc.day < 8 GROUP BY m.team SELECT m.team, SUM(pc.points) AS total_points FROM members AS m JOIN pointscount AS pc ON pc.tournamentid = m.tournament JOIN persons AS p ON p.pid = m.person WHERE p.secret = 0 AND m.tournament = 5 GROUP BY m.team Yeah, this is what I've been writing. The table `members` contain information about what kind of tournament and team a certain person is in. The table `pointscount` contain information about how many points a person has got each day of a certain tournament, one row per person per day per tournament. So yes, they are grouped as being UNIQUE together. The table `persons` contains the id of a person, but it also contains a field called secret, which if is set to true is supposed to be used to keep the points they've obtained secret after a certain date. What I want the query to do: Get the team name and get the total of points this team has earned, but this with a little twist. I want the second query to only sum the amount of points earned by the team where it's members have had their secret field in the person table set to false. The first one wants to do almost the opposite, but instead of getting everyone who has set their secret field in the person table to true, it wants to only get the point they've earned before the 8th day. o.o' Hopefully this makes any sense. Thanks in advance.
×
×
  • 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.