以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  问个select语句  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=123859)

--  作者:huangxueyao
--  发布时间:2018/8/24 20:54:00
--  问个select语句
cmd.commandtext = "sel ect a.* ,b.仓库编号,b.仓管员,b.物料类型 from 仓库入库明细表 a left join 仓库入库表 b on a.仓库入库编号 = b.仓库入库编号 where a.仓库入库编号 = (sel ect c.仓库入库编号 from 仓库入库表 c where c.关联单据 = \'" & tr42_1("采购订单编号") & "\') and c.物料编号 = \'" & tr42_1("物料编号") & "\'"


cmd.commandtext = "sel ect a.* ,b.仓库编号,b.仓管员,b.物料类型 from 仓库入库明细表 a left join 仓库入库表 b on a.仓库入库编号 = b.仓库入库编号 where  b.关联单据 = \'" & tr42_1("采购订单编号") & "\') and b.物料编号 = \'" & tr42_1("物料编号") & "\'"

会有什么区别?

--  作者:有点蓝
--  发布时间:2018/8/24 21:16:00
--  
前者这样用会出错的,因为子语句的返回值可能有多个