Site icon I Love Fitting Room

Sql query in nodejs behaving weied

I am making a query for the minimum temperature from the weather data table where the date is 2021-12-24 and getting an error unknown column date in where clause

connection.query(
    `select min(temperature) from weather_data where date=2021-12-24`,
    (err, results, field) => {
      if (err) {
        console.log(err);
      } else {
        res.status(200).send(results);
        console.log(results);
      }
    }
  );
Exit mobile version