标题:[求助]这个sql语句怎么写?
只看楼主
sjs04
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2005-12-8
 问题点数:0 回复次数:2 
[求助]这个sql语句怎么写?
我想从两个表中得到用椭圆画的6列,通过棕色的列互相关联
我写的如下:
select Material_Info.Material_Id,Material_Name,Supplier_Specification,Material_Specification,Plan_Buy_Number,unit,MaPrice
from Material_info,Material_Buy where Material_Info.Material_Id=Material_Buy_BasicInfo.Material_Id and Material_Buy_BasicInfo.Material_Buyorderid=Material_Buy.Material_Buyorderid
但是出错?我只是用过简单的单表查询,对多表查询不熟,请各位帮忙,谢谢!

[此贴子已经被作者于2005-12-11 14:32:31编辑过]

搜索更多相关主题的帖子: Material sql 语句 Buy BasicInfo 
2005-12-11 14:32
water123456
Rank: 5Rank: 5
等 级:贵宾
威 望:15
帖 子:3208
专家分:5
注 册:2006-2-21
得分:0 
select Material_Info.Material_Name,Material_Info.Supplier_Specification,
Material_Info.Material_Specification,Material_Buy.Plan_Buy_Number,
Material_Buy.unit,Material_Buy.MaPrice from Material_info,Material_Buy_basic,material_Buy
where material_info.material_Id=material_buy_basic.material_Id and
material_Buy_basic.material_buyorderid=material_buy.material_buyorderSN
你可以试这段代码,不过里面的大小写我没有太注意,你看看可以吗?我想要是没有什么大小写错误的话,应该是正确的,我也是新手,SQL2000原理是自学的,你还得仔细的看看了。

让我们风风火火的过一生,别平平淡淡过一年。
2006-02-22 11:07
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
得分:0 
[QUOTE]select Material_Info.Material_Id,Material_Name,Supplier[/QUOTE]
第一个逗号是中文的
2006-02-22 15:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-37794-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.243277 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved