I have this table.
id | promoid | fecha | Tarifa
--------------------------------------
1 | 1 | 2016-10-01 | 74.38
2 | 1 | 2016-10-02 | 74.38
3 | 2 | 2016-10-01 | 111.57
4 | 2 | 2016-10-02 | 111.57
I want to group by and show all the record by promoid between dates. I have tried with group by but i only obtain one record (the first).
This is my SQL
SELECT *
FROM promociones
WHERE fecha >= '2016-10-01'
AND fecha < '2016-10-03'
GROUP
BY promoid
when the sql run it show only first row grouped by promoid. something like this.
id | promoid | fecha | Tarifa
--------------------------------------
1 | 1 | 2016-10-01 | 74.38
3 | 2 | 2016-10-01 | 111.57
The table is so long, but i want to obtain all the rows realted by promoid. Something like this.
id | promoid | fecha | Tarifa
--------------------------------------
1 | 1 | 2016-10-01 | 74.38
2 | 1 | 2016-10-02 | 74.38
3 | 2 | 2016-10-01 | 111.57
4 | 2 | 2016-10-02 | 111.57