473,327 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Beginner help with SELECT query

I have a table which holds the results from game scores.
It has the following columns:

gameID : team1Score : team2Score

I'd like to produce output that calculates the following:

# Games played
# Wins
# Losses
# Ties
# Goals For
# Golas Against
Winning Percentage

I only know how to accomplish this using 7 seperate queries, but can I
get the same results with only one query?

Thanks!

Oct 18 '05 #1
1 1177
Your best bet would be to run 1 query that gets the totals of all of the
fields, and then do the calculating in whatever language you are using (php,
c++, etc), since the programming languages are much faster at doing
calculations that mysql is.

--
-Brandon Rohde

<se****@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have a table which holds the results from game scores.
It has the following columns:

gameID : team1Score : team2Score

I'd like to produce output that calculates the following:

# Games played
# Wins
# Losses
# Ties
# Goals For
# Golas Against
Winning Percentage

I only know how to accomplish this using 7 seperate queries, but can I
get the same results with only one query?

Thanks!

Oct 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Igor Slivka | last post by:
I have done simple php script and I have corrected every little error I got but now I stucked. I keep getting "You have an error in your SQL syntax near '' at line 9 ", and I don't know what to...
3
by: Japhy | last post by:
Hello. I am writing my first web based PHP/MYsql application. I have used the following code to retrieve the hightest value in a field : <?php mysql_connect("localhost", "root", "") or...
3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
1
by: Hought, Todd | last post by:
Hi all, trying to run a query against a table, to pull the date out, and order it. problem is, the date is stored in character (string) format, not as an actual timestamp, so parsing it back into...
5
by: MARK | last post by:
Hi, I have a printer consumables database. I have a form designed to change the status of consumables ie. in use, dead, stock etc. I select one of my consumables records from the combo box...
1
by: Tom Keane | last post by:
Hello again peoples! Okay, I have a problem to put to you guys. I don't know if this is possible or not, but yeah. What I am doing is performing a query that displays records of people according...
2
by: Keith | last post by:
Good Afternoon, New to .Net. I am trying to pass date/time values to a MS Access query depending on what value is selected from a dropdown list box (January, February, etc). I have declared...
2
by: Arvin Portlock | last post by:
My SQL experience is pretty limited, sorry if this is a REALLY basic question. I have a database of bibliographic records. Each record is of a certain type as recorded in a Type field: books,...
2
by: Riaaaa | last post by:
I m beginner for ASP.Net 2005 with C# and SQL Server 2005. I have created the form which contains many asp standard controls on it like label,textbox,checkbox,dropdownlist,command button. The...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.