Alter View Example
CREATE VIEW CustomersList
AS
SELECT c.customer_id, c.customer_name, ctr.contract_id, ctr.amount
FROM customers c, contracts ctr
WHERE c.customer_id = ctr.customer_id
AND c.customer_type='CC' ;
Customer_Id | Customer_Name | Contract_Id | Amount |
---|---|---|---|
1 | CUSTOMER_1 | 1 | 400 |
1 | CUSTOMER_1 | 4 | 1000 |
4 | CUSTOMER_4 | 6 | 900 |
ALTER VIEW CustomersList
AS
SELECT c.customer_id, c.customer_name, ctr.amount
FROM customers c, contracts ctr
WHERE c.customer_id = ctr.customer_id
AND c.customer_type='CC' ;
Customer_Id | Customer_Name | Amount |
---|---|---|
1 | CUSTOMER_1 | 400 |
1 | CUSTOMER_1 | 1000 |
4 | CUSTOMER_4 | 900 |