fixed wrong generated sql by filter CDB-2860
Merge pull request #429 from CartoDB/CDB-2860

fixed wrong generated sql by filter CDB-2860