mysql简单视图创建

我这里是4个表的视图(cases、deepcate、trade、user)

SELECT后面是视图所需字段,表名.字段名 

From 后面表名 where 是关联id

CREATE VIEW 视图名 AS SELECT
cases.id,
cases.case_title,
cases.case_content,
cases.case_addtime,
cases.case_status,
cases.case_delete,
deepcate.catename,
trade.catenames,
user.adminUname
FROM
cases,
deepcate,
user,
trade
WHERE
cases.c_id = deepcate.id AND cases.t_id = trade.id AND cases.u_id = user.id
阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页