Q:

problem with fetching records with select clause in sql

I am trying to fetch a record in particular date range and which have particular title 
for this, I am using below query
SELECT * FROM `table_name` 
WHERE `page_title` = 'Surfshark Review: Should we Surf the Internet Ocean with this VPN? (2019)' 
  AND STR_TO_DATE(`datetime`, '%Y-%m-%d') 
        BETWEEN STR_TO_DATE('2019-09-16', '%Y-%m-%d') 
                AND STR_TO_DATE('2019-09-22', '%Y-%m-%d');

when I use this query it gives me null without any error but when I use below query
SELECT `page_title` 
FROM `table_name` 
WHERE STR_TO_DATE(`datetime`, '%Y-%m-%d') 
        BETWEEN STR_TO_DATE('2019-09-16', '%Y-%m-%d') 
                AND STR_TO_DATE('2019-09-22', '%Y-%m-%d') 
GROUP BY `page_title`;

it shows me the "Surfshark Review: Should we Surf the Internet Ocean with this VPN? (2019)" within the records, I don't know why this happens.
can anybody help me with this.

A:

Nothing wrong with your query. It looks fine on a strict scenario... or it could be a data issue.
If you work like this.
SELECT....
FROM ....
WHERE  ( column like "%xxx%" )  -- a condition 
 OR 
(
  col_date BETWEEN "xxxx-xx-xx" AND "xxxx-xx-xx"   -- a condition 
   AND  anothercondition   -- a condition 
   and anothercondition     -- a condition 
)

Adding parenthesis and changing  AND/OR operators and between makes the difference. 
For more hits you can make dynamic script for your keyword search. You can use programming to generate this part of the query.
       (column like "%word%" 
    OR  column like "%anotherword%" 
   OR  column like "%anotherword%" )

