品牌 分类 产品编号 规格 尺码 条形码 库位 市场价 进货价 销售价格 是否套装 厂家货号 品名 重量 库存数量 图片地址 产品简介
select b.brandname,i.genre,isku.mjid,c.colorname,s.sizename,isku.sku,'null' as location,isku.fixedprice,isku.price inprice,isku.price outprice,'true' as suit,i.makercode,i.name,'null' as weight,isku.stock,'true' as image,i.description
from itemsku isku
left join item i on isku.mjid=i.mjid
left join brand b on isku.mjid=i.mjid and i.brandid=b.brandid
left join itemcolor ic on isku.mjid=ic.mjid and isku.colorid=ic.colorid
left join color c on ic.colorid=c.colorid
left join itemsize isize on isku.mjid=isize.mjid and isku.sizeid=isize.sizeid
left join size s on isize.sizeid=s.sizeid;
------解决方案-------------------- select * from project p join user u on (p.project_customer_id=u.user_id or p.project_developer_id=u.user_id or p.project_tester_id=u.user_id) where p.id=已知的projectID ------解决方案--------------------
楼上这个可以,
不过这样会出现
项目 用户名
1 1
1 2
1 3
LZ自己把行转换成列。
或者查询3个用户表,分别区别名就行
select p.name,a.uname,b.uname,c.uname from project p
left join user a on p.1=a.uid
left join user b on p.2=b.uid
left join user c on p.3=c.uid