以下如何错呀,,,

99_mei 2003-11-26 11:35:57
select hdAMR_d.zid,hdAMR_d.zMcode,hdAMR_d.zReq_Qty ,hdMaterialInfo.zMname,hdMaterialInfo.zSpecification,hdMaterialInfo.zUnit,hdMaterialInfo.zMatCategory_Name,hdMaterialInfo.zDrawing from hdAMR_d left OUTER JOIN hdMaterialInfo on hdMaterialInfo.zMcode=hdAMR_d.zMcode and hdAMR_d INNER JOIN hdAMR_m on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID
...全文
30 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
txlicenhe 2003-11-26
  • 打赏
  • 举报
回复
建议用别名。
select c.zid,c.zMcode,c.zReq_Qty ,b.zMname,b.zSpecification,b.zUnit,b.zMatCategory_Name,b.zDrawing
from hdAMR_d a
INNER JOIN hdAMR_m c on c.zOrder_ID=a.zMR_ID
left JOIN hdMaterialInfo b on b.zMcode=c.zMcode

pengdali 2003-11-26
  • 打赏
  • 举报
回复
select hdAMR_d.zid,hdAMR_d.zMcode,hdAMR_d.zReq_Qty ,hdMaterialInfo.zMname,hdMaterialInfo.zSpecification,hdMaterialInfo.zUnit,hdMaterialInfo.zMatCategory_Name,hdMaterialInfo.zDrawing from hdAMR_d
left JOIN hdMaterialInfo
on hdMaterialInfo.zMcode=hdAMR_d.zMcode
INNER JOIN hdAMR_m
on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID

这样才是你的意思。
pengdali 2003-11-26
  • 打赏
  • 举报
回复
select hdAMR_d.zid,hdAMR_d.zMcode,hdAMR_d.zReq_Qty ,hdMaterialInfo.zMname,hdMaterialInfo.zSpecification,hdMaterialInfo.zUnit,hdMaterialInfo.zMatCategory_Name,hdMaterialInfo.zDrawing from hdAMR_d left OUTER JOIN hdMaterialInfo on hdMaterialInfo.zMcode=hdAMR_d.zMcode

and hdAMR_d --你这里写错了。是多的。

INNER JOIN hdAMR_m on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID
pengdali 2003-11-26
  • 打赏
  • 举报
回复
select a.zid,a.zMcode,a.zReq_Qty ,b.zMname,b.zSpecification,b.zUnit,b.zMatCategory_Name,b.zDrawing from hdAMR_d a full JOIN hdMaterialInfo b on b.zMcode=a.zMcode full JOIN c c on a.zOrder_ID=c.zMR_ID
zjcxc 元老 2003-11-26
  • 打赏
  • 举报
回复
--建议这样写,规范一点
select a.zid,a.zMcode,a.zReq_Qty
,b.zMname,b.zSpecification,b.zUnit,b.zMatCategory_Name,b.zDrawing
from hdAMR_d a left OUTER JOIN hdMaterialInfo b on b.zMcode=a.zMcode
INNER JOIN hdAMR_m c on a.zOrder_ID=c.zMR_ID
j9988 2003-11-26
  • 打赏
  • 举报
回复
select
hdAMR_d.zid,
hdAMR_d.zMcode,
hdAMR_d.zReq_Qty ,
hdMaterialInfo.zMname,
hdMaterialInfo.zSpecification,
hdMaterialInfo.zUnit,
hdMaterialInfo.zMatCategory_Name,
hdMaterialInfo.zDrawing
from hdAMR_d left OUTER JOIN hdMaterialInfo --用FULL JOIN 或LEFT JOIN
on hdMaterialInfo.zMcode=hdAMR_d.zMcode
and hdAMR_d INNER JOIN hdAMR_m on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID
zjcxc 元老 2003-11-26
  • 打赏
  • 举报
回复
select hdAMR_d.zid,hdAMR_d.zMcode,hdAMR_d.zReq_Qty
,hdMaterialInfo.zMname,hdMaterialInfo.zSpecification
,hdMaterialInfo.zUnit,hdMaterialInfo.zMatCategory_Name
,hdMaterialInfo.zDrawing
from hdAMR_d left JOIN hdMaterialInfo on hdMaterialInfo.zMcode=hdAMR_d.zMcode
INNER JOIN hdAMR_m on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID
Benimarunikado 2003-11-26
  • 打赏
  • 举报
回复
楼主兄,语法不对啊~

select hdAMR_d.zid,hdAMR_d.zMcode,hdAMR_d.zReq_Qty ,hdMaterialInfo.zMname,
hdMaterialInfo.zSpecification,hdMaterialInfo.zUnit,hdMaterialInfo.zMatCategory_Name,
hdMaterialInfo.zDrawing
from hdAMR_d left OUTER JOIN hdMaterialInfo
on hdMaterialInfo.zMcode=hdAMR_d.zMcode
INNER JOIN hdAMR_m
on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID
erigido 2003-11-26
  • 打赏
  • 举报
回复
我数了一下,楼上共有23颗星。。。。。星光灿烂啊
tangxc2003 2003-11-26
  • 打赏
  • 举报
回复
select hdAMR_d.zid,
hdAMR_d.zMcode,
hdAMR_d.zReq_Qty ,
hdMaterialInfo.zMname,
hdMaterialInfo.zSpecification,
hdMaterialInfo.zUnit,
hdMaterialInfo.zMatCategory_Name,
hdMaterialInfo.zDrawing
from hdAMR_d
left OUTER JOIN hdMaterialInfo on hdMaterialInfo.zMcode=hdAMR_d.zMcode
INNER JOIN hdAMR_m on hdAMR_d.zOrder_ID=hdAMR_m.zMR_ID
hglhyy 2003-11-26
  • 打赏
  • 举报
回复

select 字段 from A left OUTER
JOIN B on A.字段=B.字段
INNER
JOIN C on A.字段=C.字段

34,681

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧