Got this error on administrator panel of a Joomla 3 website recently. Since it appeared on almost all list views, it was obvious that this was not something limited to one list view. After looking for a possible cause and a solution I found that following code snippet was inserted into the getItems() function of /legacy/model/list.php file.
$query->where('a.id != 9417');
The number 9417 might be different in each case. Couldn’t figure out where does it come from.
Removing the above code with get your site back to normal. But this is more likely a result of a hack attack. This tells you that you need pay more attention to the security of your Joomla site.