日期:2014-05-17  浏览次数:20818 次

求教一视图的简单问题!!给分!!!
好不容易把存储过程摸得入门了,但是试着用它来做联合查询,硬是查不出来,一问老大,他说要用视图才可以,于是我又马不停蹄的来整视图,学视图,可是从网上下载的视图都是ACCESS下的,听老大说,ACCESS和SQL调用存储过程不一样,于是特来论坛求教了,请问有何不同呢?还有有哪位前辈有SQL存储过程的范例的调用,顺便粘贴出来共享下啊,我本人将如滔滔黄河水感激不尽~~~~~

------解决方案--------------------
帖一个我写的现成的给你看,三表的视图。里面用到左联和内联。内联在视图用的比较多。

CREATE view view_feedback
as
SELECT a.id,a.user_id, a.title, a.content, a.type, a.adddate, b.repeotype, b.content AS recontent,
b.adddate AS readddate,b.flag, c.p_uname, c.p_name
FROM user_feedback as a left JOIN
user_refeedback as b ON a.id = b.f_id INNER JOIN
cu_reg as c ON a.user_id=c.p_id