title: mysql query - In a table, if a date exist return record else return previous date's record
body: <p>If user input date is <code>2021-08-08</code> (date present in table), it should return records having this date. If user input date is <code>2021-08-07</code> (date not present in table), it should return records <code>2021-08-05</code> for the date (previous available date).</p>
  <p>Sample data:</p>
  <p><img src="https://i.stack.imgur.com/zjigs.png" alt="dummy_table for more details" /></p>