472,103 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Base a query on a query.

Hi,

I have created a stored procedure in mysql. It bassically calculates scores for people in a competition. So on day one they might get 4, day two 5 etc etc.

I now want to sum the calculated score field that the stored procedure computes but have no idea how to do it.

I am very familiar with Access and new at MYSQL. In Access I create a computedailyscores query and then do another query that sums the computerdailyscore field.

How would I do this in mysql?

Cheers
Sep 3 '07 #1
4 1064
r035198x
13,262 8TB
Hi,

I have created a stored procedure in mysql. It bassically calculates scores for people in a competition. So on day one they might get 4, day two 5 etc etc.

I now want to sum the calculated score field that the stored procedure computes but have no idea how to do it.

I am very familiar with Access and new at MYSQL. In Access I create a computedailyscores query and then do another query that sums the computerdailyscore field.

How would I do this in mysql?

Cheers
Does your stored procedure take the date as a parameter?

You can use the same approach you used in Access as well.
Sep 3 '07 #2
Does your stored procedure take the date as a parameter?

You can use the same approach you used in Access as well.
Thnaks for the quick response.

There is no date in the stored procedure as yet, there maybe in the future though. Does this matter?

In access I would just reference the query in the from statement like

Select fields
From QueryName

When I do this in MYSQL query browser I just get an error saying the table doesn't exist. I just can't seem to find how to reference the stored procedure.
Sep 3 '07 #3
r035198x
13,262 8TB
Thnaks for the quick response.

There is no date in the stored procedure as yet, there maybe in the future though. Does this matter?

In access I would just reference the query in the from statement like

Select fields
From QueryName

When I do this in MYSQL query browser I just get an error saying the table doesn't exist. I just can't seem to find how to reference the stored procedure.
Do you mean procedure or view then? In MYSQL you can select from a view.
Sep 3 '07 #4
I have currently done it as a procedure.
Sep 3 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Paul | last post: by
1 post views Thread by NomoreSpam4Me | last post: by
7 posts views Thread by David Bear | last post: by
2 posts views Thread by Michael Bray | last post: by

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.