I have a table e.g. Customers(CustomerType, Name)
and two views for each customer type:
create view PremiumCustomers as
(
select Name from Customers where CustomerType = 1
);
and
create view NormalCustomers as
(
select Name from Customers where CustomerType = 2
);
Is there a way I could insert into each of these views and set the default value for CustomerType
accordingly?
e.g. by using:
INSERT INTO PremiumCustomers (name) VALUES ('foo')
to insert ('foo',2)
to the Customers
table.