MySQL视图的概念与实际应用
复制create table product ( product_id int not null,视实际 name varchar(50) not null, price double not null ); insert into product values(1, apple , 5.5); create table purchase ( id int not null, product_id int not null, qty int not null default 0, gen_time datetime not null ); insert into purchase values(1, 1, 10, now());
create view purchase_detail as select product.
name as name, product .price as price, purchase.qty as qty,

product .price * purchase.qty as total_value from product,
purchase where product.product_id = purchase.product_id; 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.本文地址:http://www.bzve.cn/html/573f1699410.html
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。