日期:2014-05-17 浏览次数:20883 次
select c.name as username,c.id,w.id as userid,
w.name as usernameto
from t_o_item a,t_b_accttype b,t_acl_user c,
t_o_objectuser v,t_acl_user w
where a.itemuserid = c.id and v.userid = w.id and
a.itemid = v.objectid and a.itemid is not null and a.itemstate = b.listvalue and
v.objecttype = '2' and b.maintype = 'itemstate'
a.itemuserid = c.id --a表与c表的关联方式
a.itemid = v.objectid and v.userid = w.id --a表通过v表与再与w表关联。关联的字段是不同的