Issue #1210: Missing table prefix

Added table prefix to query