title: mySQL Select All where date is less than 1 day from max date in data
body: <p>I am having a table name &quot;raw&quot;.
  The date column is not having all the dates of month as it does not record holidays or when there were no sales for the day.
  I am trying to get the data form the date less than a day of specific date or max date but it is not returning the search as before the max date was holiday.
  here are the dates:
  2021-07-09
  2021-07-07
  2021-07-03
  2021-07-02
  2021-07-01
  2021-06-30</p>
  <pre><code>SELECT *
      FROM raw
      WHERE date=(SELECT MAX(date) - 1 FROM raw);
  
  or
  
  SELECT *
  FROM raw
  WHERE date=(SELECT MAX(date) - interval 1 day FROM raw);
  
      \begin{table}[]
  \begin{tabular}{lll}
  Name  &amp; Date       &amp; Sales \\
  ACC   &amp; 2020-07-09 &amp; 2000  \\
  BEL   &amp; 2020-07-09 &amp; 200   \\
  Dabur &amp; 2020-07-09 &amp; 600   \\
  ACC   &amp; 2020-07-07 &amp; 450   \\
  GMR   &amp; 2020-07-07 &amp; 12    \\
  ACC   &amp; 2020-07-03 &amp; 450   \\
  ITC   &amp; 2020-07-03 &amp; 45    \\
  Dabur &amp; 2020-07-03 &amp; 350   \\
  GMR   &amp; 2020-07-03 &amp; 450   \\
  BEL   &amp; 2020-06-30 &amp; 500   \\
  GTL   &amp; 2020-06-30 &amp; 850   \\
  Dabur &amp; 2020-06-30 &amp; 100   \\
  ACC   &amp; 2020-06-27 &amp; 50    \\
  Dabur &amp; 2020-06-27 &amp; 125  
  \end{tabular}
  \end{table}
  </code></pre>