BUG: Add QUERY needed by wmql