I am querying my data using this query
SELECT date_col,max(rate) FROM crypto group by date_col ;
I am expecting a single row but it is returning all the rows in the table. What is the mistake in this query?
I am querying my data using this query
SELECT date_col,max(rate) FROM crypto group by date_col ;
I am expecting a single row but it is returning all the rows in the table. What is the mistake in this query?
You'll get one row per
date_colbecause you're grouping by it. If you just want the maximumratethen just doSELECT max(rate) FROM crypto;.If you want to get the
date_colfor that record too then: