fix where with @SQL in ditto