Possible Duplicate:
Use SQL View or SQL Query?
What is the reason writting a views instead of writting a sql statement?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, there are lots of reasons.
invoices_2011view with just invoices made in 2011 from the tableinvoices.Update:
On the example asked:
Let’s say you have this table:
And you want user
bartto see onlynameanddobof customers born before 1980. You can’t grant access tocustomerstable tobartbecause he could see anything stored on it.You instead create a view:
And then grant
bartaccess to that view:This way,
bartwill only have access to the restricted view subset ofcustomerstable.