I have a query that returns the average of 2 columns of type float, the thing is to change the date from date to datetime to be able to insert it with the time and now the query does not work, I return null in both columns
the table is:
create table mediciones(
id int not null primary key AUTO_INCREMENT,
temperatura float not null,
humedad float not null,
idvinedo int not null,
fecha datetime not null,
FOREIGN KEY (idvinedo) REFERENCES vinedo(id));
and the query is:
SELECT AVG(temperatura) as temperatura, AVG(humedad) as humedad from
mediciones WHERE idvinedo=1 and fecha='2018-09-26'
the database gives me the following message when I run the query:
The current selection does not contain a single column.
I hope you can help me