带插入查询的特殊循环 [英] Special loop with insert query
问题描述
你好,
我会解释一下我想做什么:
我的桌子(选择.. FROM .. WHERE)
我想使用这个表格,例如我们有:
C,D为整数
A ,B,R,E为字符串
A________B______C_____R_____D___________E
P65_____A98____10_____r1____1___________我们可以
P65_____A98____10_____r1____2___________blabla
P65_____A98____10_____r1____3___________youhou
P65_____A98____10_____r2____1___________ hello
P65_____A98____20_____r1____1___________是是是
P65_____A98____20_____r2____1___________是另一个
P65_____A98____20_____r2____2___________评论
P65_____A98____20_____r2____3____________ain
我不知道有多少不同的CI可以拥有相同的A,B
我不知道有多少不同的RI可以拥有相同的A,B,C
我不是知道有多少不同的DI可以用于相同的A,B,C,R
D是评论的顺序
我想要在同一个案例中做一个循环让所有的注释用逗号分隔(在将其插入Acess表后)
A________B______C_____R_____E
P65_____A98____10_____r1 _____可以,blabla,youhou
P65_____A98____10_____r2 ____
P65_____A98____20_____r1____是的是
P65_____A98____20_____r2____是另一个,评论,再次
Hello,
I will explain what I would like to do:
My table ( Select.. FROM.. WHERE)
I would like to use this table for example we have :
C,D as integer
A,B,R,E as string
A________B______C_____R_____D___________E
P65_____A98____10_____r1____1___________yes we can
P65_____A98____10_____r1____2___________blabla
P65_____A98____10_____r1____3___________youhou
P65_____A98____10_____r2____1___________hello
P65_____A98____20_____r1____1___________yes yes yes
P65_____A98____20_____r2____1___________it is an other
P65_____A98____20_____r2____2___________comment
P65_____A98____20_____r2____3___________again
I don''t know how many different C I can have for the same A,B
I don''t know how many different R I can have for the same A,B,C
I don''t know how many different D I can have for the same A,B,C,R
D is the order of comments
I would like to make a loop to have all the comments separated by a comma in the same case ( to after insert it in an Acess table )
A________B______C_____R_____E
P65_____A98____10_____r1____yes we can, blabla ,youhou
P65_____A98____10_____r2____hello
P65_____A98____20_____r1____yes yes yes
P65_____A98____20_____r2____it is an other, comment, again
推荐答案
我不确定这个问题的基于SQL的解决方案,但是这里可以使用与此Thread相同的方法。
http://bytes.com/topic/access/answer ... mn-values-rows
您可以根据字段[A],[b],[C]和[R]的不同值生成记录集。然后,您可以遍历此Recordset并连接每个唯一组合的注释。然后可以将结果写入结果表。这种方法有点牵强,所以请耐心等待,看看是否出现了其他更有效的基于SQL的解决方案。
I am not sure concerning an SQL based solution to this problem, but the same approach as used in this Thread can be used here.
http://bytes.com/topic/access/answer...mn-values-rows
You could generate a Recordset based on Distinct Values for Fields [A], [b], [C], and [R]. You could then Loop through this Recordset and concatenate the Comments for each unique combination. The Results could then be written to a Results Table. This approach is a little far fetched, so be patient and see if any other, more efficient, SQL based solutions arise.
目前我有一个查询,一个记录集来创建表在我有了这个之后
For the moment I have a query, a recordset to create the table and after I have this
哦对不起我在帖子中犯了一个大错误
A,B,C,R在一个查询中(选择信息)
表中的A,B,C,D,E(基于的描述) A,B,C)
我可以在openrecordset中使用查询吗?因为我想在之前链接描述和查询以运行代码以使所有描述符都在同一个案例中
Oh sorry I made a BIG mistake in my post
A,B,C,R are in a query ( to select informations )
A,B,C,D,E in a table ( to take description based on A,B,C)
Can I use a query in a openrecordset too ? Because I would like to link description and the query before to run the code to have all the descriptons in the same case
这篇关于带插入查询的特殊循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!