Hello,everybody. I'm needing some help and am a complete newb to MySQL, so here I go.
I've just switched my DB from MS SQL Server 2000 to MySQL 5. I was using a query that looks like this:
select FlTdate Fecha, count(TotBoarded) Vuelos
from transactions
where TxnAmount = 0
and TotBoarded <> 0
and Origin = 'JFK'
group by all FltDate
having FltDate between '2005-10-16' and '2005-10-29'
order by FltDate
Notice the "group by all" line
When conditions are not fullfilled (everything under "where"), I get an empty row (a.k.a. nothing). But then, I need a zero on that row.
GROUP BY ALL worked in SQL Server 2000 (that is, I got a zero where there existed a
date but was no data), but MySQL doesn't include this specific function.
Here, this example should make all this more understandable.
I'm getting this as result:
Fecha | Vuelos
2005-11-10 00:00:00 | 2
2005-11-11 00:00:00 | 2
2005-11-15 00:00:00 | 1
and I want to get this:
Fecha | Vuelos
2005-11-10 00:00:00 | 2
2005-11-11 00:00:00 | 2
2005-11-12 00:00:00 | 0
2005-11-13 00:00:00 | 0
2005-11-14 00:00:00 | 0
2005-11-15 00:00:00 | 1
Any ideas on how to do this?
Thx