subquery with date and max() -
i have problems query. shall return max temperature of day returns empty. have done wrong?
select * tempdat date( tdate ) = curdate( ) , temperature = ( select max( temperature ) tempdat ) ;
rather use:
select convert(datetime, convert(varchar(12), tdate )) dayoftemp ,max(temperature) maxtemp tempdat convert(datetime, convert(varchar(12), tdate )) = convert(datetime, convert(varchar(12, curdate( ) )) group convert(datetime, convert(varchar(12), tdate ))
Comments
Post a Comment