当前位置:Gxlcms > 数据库问题 > mysql(4,视图)

mysql(4,视图)

时间:2021-07-01 10:21:17 帮助过:2人阅读

cust_name,cust_contact FROM customers c inner join orders o on c.cust_id=o.cust_id inner join orderitems oi on oi.order_num=o.order_num and prod_id=TNT2

2 .创建 视图  productcustomers(没有

 prod_id=‘TNT2‘限制条件

)

create view productcustomers as 
select cust_name,cust_contact,prod_id FROM
customers c inner join orders o on c.cust_id=o.cust_id
inner join orderitems oi on oi.order_num=o.order_num

技术分享

 

3. 查询视图(使用 where prod_id=‘TNT2‘)

技术分享

4.show create view xxx

 技术分享

 5.drop view xxx 删除视图

mysql(4,视图)

标签:

人气教程排行