I am trying to query the database and have to query the transactions from last 10 days. There are 2 options that I can think of doing this considering today’s date is 08/24.
Use DATE_DIFF_STR and give 10 as an input to the function to get the last 10 days transactions
I also have a ‘date’ field in the document. I can write a query like this:
where type = 'doc_type' and date >='2021-08-14'
Which of the above 2 options would be efficient? Using DATE_DIFF_STR or using >= operator?