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 6783923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:55:45+00:00 2026-05-26T16:55:45+00:00

I have the following simple MySQL query, called from PHP: SELECT foo_id, SUM(number_of_guests) FROM

  • 0

I have the following simple MySQL query, called from PHP:

SELECT foo_id, SUM(number_of_guests)
FROM guests 
WHERE foo_id = $foo_id
GROUP BY foo_id

This works fine, except for one $foo_id, which returns about 2.5 times greater than the sum of the number_of_guests field.

What could cause this behavior for only a certain value of $foo_id?

Is there a better way to do this?

  • 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-26T16:55:46+00:00Added an answer on May 26, 2026 at 4:55 pm

    The problem is that there was one row with a large value for number_of_guests. I didn’t see in in browsing the data because there are a few hundred rows. It didn’t show up when I copied and pasted from HTML page into Excel because that row was missing most of the other columns, and the HTML page has all the columns.

    Thanks for all your help!

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

Sidebar

Related Questions

Let's say I have the following simple query SELECT TOP 1 name FROM months
I have this MySQL query that I'd like to optimize: SELECT min(`topic_id`) FROM `gallery_topics`
I have the following piece of code, executing a pretty simple MySQL query: $netnestquery
I have following query on a MySQL DB: SELECT * , r.id, x.real_name AS
I have a simple query like this SELECT hometeam.name AS hometeamName, hometeam.shortname AS hometeamShortName,
I have a simple mysql table called messages with the following fields: ID(int) MESSAGE(varchar)
I have the following query: mysql> explain SELECT Exhibition.venue_id, Exhibition.name, Exhibition.slug, Venue.name, Venue.slug, Venue.location_id,
I have the following simple function: private void EnableDisable941ScheduleBButton() { if (this._uosDepositorFrequency.Value != null)
I have the following simple Java code: package testj; import java.util.*; public class Query<T>
i have the following simple code, but it doesn,t work <ul> <li id=one onmouseover=this.style.background-color='white';>

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.