user3097751
user3097751

Reputation: 1

When do you have to use a view instead of joining? - SQL

My professor stated that certain queries need to use a view, instead of a join because a join will calculate values multiple times - producing an incorrect result. Why does this happen? And how does a view protect from that?

Upvotes: 0

Views: 132

Answers (1)

Kias
Kias

Reputation: 841

If you're using a view in place of a join then your view probably contains a join. A view is simply a stored query. It presents to you a virtual single table but may be made up of joins across many tables, or it may contain aggregated data.

Based on that, I'm assuming there is more to your professors logic because your statement doesn't make sense.

Upvotes: 3

Related Questions