MySQL Forums
Forum List  »  Newbie

Why might this statement only return one row
Posted by: Tyler Barton
Date: October 08, 2016 11:14AM

I have a test table that has 4 rows that fall into the conditions of this SQL statement but it is only returning 1.

My goal in all this is that I need a statement that returns all the rows that fall withing a range but I also need a count of the total number rows in the return.

This statement is to be used in a PHP page that is then encoded to JSON and passed to various functions.

SELECT *, COUNT(id) AS Total FROM icalendar.event where start between 1475280000000 and 1477958399000;

It returns one row with a column total = 4 which is correct, there should be 4 rows but it only returns one.

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Why might this statement only return one row
October 08, 2016 11:14AM


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.