select
b.codeNum as 移库单号,
convert(char(10),b.OptTime,120) as 移库日期,
b.Supplyid as 移出仓库,
d.StoreName as 移入仓库,
a.UniCode as 零件号,
a.UniName as 名称 ,
e.[Size] as 型号,
a.Unit as 单位,
a.Quantity as 数量,
a.price as 单价,
a.amut as 金额
from JS_InListTbl a,JS_InStoTbl b,JS_SupplyTbl c,JS_StoreTbl d,JS_SysItemTbl e
where b.perftype=9 and b.StoreID=d.StoreID and a.unicode =e.UniCode and a.billnum =b.billnum 怎么把这里面的 移出仓库id 关联成 仓库名。其实就是 StoreTbl d 表中的 d.StoreName 名
谢谢 急,不明白的可以加我qq 17286375。
就是一个移出仓库 移入仓库都关联一个表,。查询结果都要显示仓库名。
b.codeNum as 移库单号,
convert(char(10),b.OptTime,120) as 移库日期,
b.Supplyid as 移出仓库,
d.StoreName as 移入仓库,
a.UniCode as 零件号,
a.UniName as 名称 ,
e.[Size] as 型号,
a.Unit as 单位,
a.Quantity as 数量,
a.price as 单价,
a.amut as 金额
from JS_InListTbl a,JS_InStoTbl b,JS_SupplyTbl c,JS_StoreTbl d,JS_SysItemTbl e
where b.perftype=9 and b.StoreID=d.StoreID and a.unicode =e.UniCode and a.billnum =b.billnum 怎么把这里面的 移出仓库id 关联成 仓库名。其实就是 StoreTbl d 表中的 d.StoreName 名
谢谢 急,不明白的可以加我qq 17286375。
就是一个移出仓库 移入仓库都关联一个表,。查询结果都要显示仓库名。
select
b.codeNum as 移库单号,
convert(char(10),b.OptTime,120) as 移库日期,
f.StoreName as 移出仓库,
d.StoreName as 移入仓库,
a.UniCode as 零件号,
a.UniName as 名称 ,
e.[Size] as 型号,
a.Unit as 单位,
a.Quantity as 数量,
a.price as 单价,
a.amut as 金额
from JS_InListTbl a,JS_InStoTbl b,JS_SupplyTbl c,JS_StoreTbl d,JS_SysItemTbl e
join StoreTbl f on f.StoreName=b.Supplyid
where b.perftype=9 and b.StoreID=d.StoreID and a.unicode =e.UniCode and a.billnum =b.billnum--try 估计你这查询有问题
join tab a on a.zz=t.col1
join tab b on b.zz=t.col2
但是带到自己的项目语句里就有问题了。
汗。 求助。select
b.codeNum as 移库单号,
convert(char(10),b.OptTime,120) as 移库日期,
f.StoreName as 移出仓库,
m.StoreName as 移入仓库,
a.UniCode as 零件号,
a.UniName as 名称 ,
e.[Size] as 型号,
a.Unit as 单位,
a.Quantity as 数量,
a.price as 单价,
a.amut as 金额
from JS_InListTbl a,JS_InStoTbl b,JS_SupplyTbl c,JS_StoreTbl d,JS_SysItemTbl e
join JS_StoreTbl f on b.Supplyid = f.StoreID
join JS_StoreTbl m on b.StoreID =m.StoreID where b.perftype=9 and b.StoreID=d.StoreID and a.unicode =e.UniCode and a.billnum =b.billnum提示错误:
服务器: 消息 107,级别 16,状态 2,行 1
列前缀 'b' 与查询中所用的表名或别名不匹配。
请帮忙查下哪错了
要么不用join,全放where后面,以逗号分隔