[Solved] How to fetch data from a table matching multiple filters?


This returns all columns from tbl_records for the user with the f_name ‘Kr’, with date_of_record on or later than midnight today.

SELECT r.* FROM tbl_records r
INNER JOIN tbl_users u ON r.user_id = u.user_id
WHERE r.date_of_record >= DATE(NOW()) AND u.f_name LIKE 'Kr'

Though it’s usually better to specify the exact columns you want, in case the table definition is changed later:

SELECT r.user_id, r.status, r.date_of_record FROM tbl_records r
INNER JOIN tbl_users u ON r.user_id = u.user_id
WHERE r.date_of_record >= DATE(NOW()) AND u.f_name LIKE 'Kr'

solved How to fetch data from a table matching multiple filters?