If I write:
SELECT * FROM table_name WHERE date BETWEEN "2014/07/01" AND "2014/07/04"
I get 4 records returned which is what I want. But I also want the total number of records which in this case is 4, but if I write:
SELECT *, count(*) AS total FROM table_name WHERE date BETWEEN "2014/07/01" AND "2014/07/04"
It displays total 4, but only one record.
How can I display all 4 records and "total 4"?
SELECT * FROM table_name WHERE date BETWEEN "2014/07/01" AND "2014/07/04"
I get 4 records returned which is what I want. But I also want the total number of records which in this case is 4, but if I write:
SELECT *, count(*) AS total FROM table_name WHERE date BETWEEN "2014/07/01" AND "2014/07/04"
It displays total 4, but only one record.
How can I display all 4 records and "total 4"?
Comment