###### weixin_39127625

2017-06-21 06:29 浏览 1.1k

# access sql复杂查询语句求助

1/1    A    0.1
1/1    B    0.1
1/1    C    0.1
1/2    A    0.1
1/2    B    0.1
1/3    A    0.1
1/3    C    0.1
1/4    B    0.1
1/4    C    0.1

1/1   A    0.1
1/1   B    0.1
1/1   C    0.1
1/2   A    0.1
1/2   B    0.1
1/2   C    -
1/3   A    0.1
1/3   B    -
1/3   C    0.1
1/4   A    -
1/4   B    0.1
1/4   C    0.1

• 点赞
• 写回答
• 关注问题
• 收藏
• 复制链接分享
• 邀请回答

#### 1条回答默认 最新

• 已采纳

下面这个示例居于你上个问题进行处理，要组合成你上个问题的字符串先

``````

str="1/1,A,0.1*1/1,B,0.2*1/2,A,0.2*1/3,B,0.2*1/4,C,0.1"
arr=split(str,"*")
l=ubound(arr)
sdate=","
set kv=server.CreateObject("scripting.dictionary")
for i=0 to l
itemarr=split(arr(i),",")
if instr(sdate,","&itemarr(0)&",")=0 then sdate=sdate&itemarr(0)&","'搜集所有日期
next
''''输出
arr=split(sdate,",")
l=ubound(arr)
for i=0 to l
if arr(i)<>"" then
key=arr(i)&" A"
if kv.Exists(key) then response.Write key&" "&kv(key)&"<br>":else:response.Write key&" -<br>":end if
key=arr(i)&" B"
if kv.Exists(key) then response.Write key&" "&kv(key)&"<br>":else:response.Write key&" -<br>":end if
key=arr(i)&" C"
if kv.Exists(key) then response.Write key&" "&kv(key)&"<br>":else:response.Write key&" -<br>":end if
''''更加多状态
end if
next
set kv=nothing
``````
点赞 1 评论 复制链接分享