Fixed some problems with making new queries

Making SELECT JOIN by WHERE clause is available now