Fourth, we can also query the data from the base table items to verify if the DELETE statement actually deleted the row. In this tutorial, we have shown you how to create an updatable view and update data in the underlying table through the view. Up Next. By Priya Pedamkar. SQL view is nothing but a virtual table of the database. The view contains fields like a real table, but those fields are from one or more tables in the database which is executed by running a bunch of MySQL queries.
FROM table;. JOIN: We also can create a view by joining multiple tables. This join will fetch matched records from both the tables. Active 4 years, 3 months ago. Viewed 17k times. Also, would I be able to update a view that is made up of more than one base table?
Bob Stein Add a comment. Active Oldest Votes. As documented under Updatable and Insertable Views : Some views are updatable. VIEWS table and my view is updatable. Although i have explicitly granted update privilege on the particular view.
Any idea why would i be getting this error? It clearly says that we cannot modify more than one base table if the view is created through a join. In our example, the vwEmployeesByDepartment view is created through a join and we are trying to update the Department Name from the Department table and salary from the Employee table and hence we got the following error.
Error Code: Now we want to update the Salary of Sambit from to using the view. When you execute the above update statement, it updates the Salary as expected in the Employee table.
Once you execute the above SQL query, you will get the following output and observe the Salary of Sambit which is updated as expected.
0コメント