创建sql 视图
来源:百度知道 编辑:UC知道 时间:2024/06/30 04:47:50
我已经创建了一个sql视图如下:
CREATE VIEW Cust_titleview
AS
SELECT title, au_lname, price, pub_id
FROM titleview
但是我还想往里面添加一些数据如:
SELECT title, au_lname, price, pub_id
FROM titleview2
怎样来做呢?
CREATE VIEW Cust_titleview
AS
SELECT title, au_lname, price, pub_id
FROM titleview
但是我还想往里面添加一些数据如:
SELECT title, au_lname, price, pub_id
FROM titleview2
怎样来做呢?
SELECT title, au_lname, price, pub_id
FROM titleview
union all
SELECT title, au_lname, price, pub_id
FROM titleview2
SELECT title, au_lname, price, pub_id
FROM titleview
union all
SELECT title, au_lname, price, pub_id
FROM titleview2
你可以用楼上的这种方式。但如果查询的话,这中方式并不是好好的方式。
使用union all 将两条select 查询得到的记录合并起来,具体如1楼
重新修改VIEW
给分一楼吧....