Add query joining all necessary views