I have this query and I know that I can't have limit clause in subquery for mysql is there anyway to write this in a correct syntax?
UPDATE:(SCENARIO)I want to maintain deleted visitors and when we want to select deleted visitors I should select distinct ips
$deletedvisitors = $wpdb->get_var("
SELECT count(DISTINCT ip)
FROM $table_name
WHERE feed=''
AND spider=''$normallimit AND id IN ( SELECT * FROM ". $table_name . " order by id limit $delneeded)");