(3.1.4)
Fatal error: Uncaught exception Exception with message Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 (SELECT company, concat(lastname,', ',firstname) as "Name",street,postal,city,phone,fax,mobile,email,website FROM tl_member WHERE ((1=1 or 1>0)) AND id='4') thrown in system/modules/core/library/Contao/Database/Statement.php on line 282
You can spend quite a while (!) looking for the error: there is none (visible), and pasting the query into another program will prefectly return the result wanted.
Editing
company,concat(lastname,', ',firstname) as "Name",street,postal,city,phone,fax,mobile,email,website
results in the following stored value in the list_info column:
company,concat(lastname,', ',firstname) as "Name",street,postal,city,phone,fax,mobile,email,website
Solution: add 'decodeEntities'=>true, to the list_info DCA field.
Also see #6337. I am fixing this problem as well.