abdfahim
Well-known member
Hi,
Is there any performance difference between the following two?
Objective: Get all records of the latest date
Is there any performance difference between the following two?
Objective: Get all records of the latest date
PHP:
$db = \XF::db();
$results = $db->fetchAll("SELECT * FROM my_table WHERE my_date IN (SELECT max(my_date) FROM my_table)");
PHP:
$max_date = $finder->order('my_date', 'DESC')->limit(1)->pluckFrom('my_date')->fetch();
$results = $finder->where('my_date', $max_date)->fetch();