永发信息网

excel中的SQL语句详细解释

答案:2  悬赏:10  手机版
解决时间 2021-02-06 23:02
  • 提问者网友:却不属于对方
  • 2021-02-06 07:53
SQL = "select a.序号,a.压力时间 from [Excel 8.0;Database=" & ActiveWorkbook.FullName & "].[数据$" & Range("a1").CurrentRegion.Address(0, 0) _
& "] a left join " & myTable & " b on a.序号=b.序号 where b.压力时间 is not null"
谁能帮我详细的解释一下这句话
最佳答案
  • 五星知识达人网友:躲不过心动
  • 2021-02-06 08:49
在两个以序号组合的表格ab中查询B表压力时间不为空的序号和压力时间
全部回答
  • 1楼网友:迷人又混蛋
  • 2021-02-06 09:38
首先你写的语句是有问题的 distinct不能这么用 select distinct 区域,站点,重量 from [外单接货$] 改成这样语法是对的,但是结果不知道是不是你想要的 以下语句在excel 2013 测试通过: set conn1 = createobject("adodb.connection") conn1.open "provider=microsoft.jet.oledb.4.0;extended properties='excel 8.0;hdr=yes;imex=2;';data source='" & thisworkbook.fullname & "'" sql = "select * from [" + dp2 + "$] where left(ciodes,1) = '9' or ciodes like '%花河%' " sheets(1).range("a2").copyfromrecordset conn1.execute(sql)
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯