Reputation: 7980
It's probably a silly question but it is straight forward.
Is it possible to create a view from an existing view?
Let's say I've tableA. I create vwtableA from tableA and now I want to create vvVwtableA from vwtableA.
In pseudo-code it would be something like:
create view vwA as select * from tableA;
create view vwvwA as select * from vwA;
is this possible? I'm trying something like this and I get no MySQL errors executing the statment but I can't browse the second view... MySQL Workbench keeps loading for ever and I don't know if this may be the cause.
My tableA has around 100 000 records, vwA has around 50 000 records and vwvwA should have around 50 000 as well.
Upvotes: 10
Views: 12855
Reputation: 1756
Yes, it is possible. See MySQL documentation
The select_statement is a SELECT statement that provides the definition of the view. (When you select from the view, you select in effect using the SELECT statement.) select_statement can select from base tables or other views
Upvotes: 7
Reputation: 8177
just make a copy of your first view (vwA) and create a new one (vwvwA) . Simple this way. ;-)
Upvotes: 0