MySQL Forums
Forum List  »  Stored Procedures

Re: Problem with stored procedures on phpmyadmin
Posted by: Andrew James
Date: August 17, 2016 02:35PM

The problem is that if I took out group by and then test it out by

SELECT COUNT(files.FileID) from files,Users where files.UserID = Users.UserID

the result is 4 and 4 came from where the total of files not for each file id. The call procedure actually works without group by like call getallfiles()

and the results are:

Files firstname lastname EmailAddress
chocolate bar Steve Jones jones@gmail.com
pie Michael James michael@gmail.com
milk Steve jones jones@gmail.com
milk Steve jones jones@gmail.com





If I want to count by each then I would use group by and get this result without calling stored procedure.

SELECT COUNT(files.FileID) from files,Users where files.UserID = Users.UserID group by files.FileID and the result is

" COUNT(files.FileID)
1
1
1
1"

If I call the stored procedure that has group in in like call getallfiles(); I will get an error message.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Problem with stored procedures on phpmyadmin
323
August 17, 2016 02:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.