本文介绍了有关Delphi 7,ADO和&的帮助MS Access SQL语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有三个表(在MS Access Database 2000文件* .mdb中)I have three tables (in a MS Access Database 2000 file *.mdb)知识 id 问题 答案Knowledgeidquestionanswer Knowledge_Keywords id 知识ID keywordidKnowledge_Keywordsidknowledgeidkeywordsid关键字 id 关键字Keywordsidkeyword需要全部获取知识的关键字Need to get all the keywords for a knowledge从关键字KW 中选择不同的关键字在KKW.joinword_id = KW.id $ b $上加入Knowledge_keywords KKW b在K.id = KKW.knowledgeid 上加入知识K,其中k.id = 10Select distinct keyword from keywords KWJoin knowledge_keywords KKW on KKW.keywordid = KW.idJoin Knowledge K on K.id = KKW.knowledgeidWhere k.id = 10当然10是一个示例,我实际上使用of course 10 is a example, i actually use a parameter there其中k.id =:AKnowId';Where k.id = :AKnowId';并填写代码 qry.Parameters.ParamByName('AKnowId')。Value:= AKnowledgeId;qry.Parameters.ParamByName('AKnowId').Value:= AKnowledgeId;无论如何,我认为SQL可能会出错,将不胜感激anyway, i think the SQL is qrong, any help would be greatly appreciated推荐答案解决了!从不同的关键字中选择 (关键字KW 内部,在KKW.joinword_keywordid = KW.id上加入Knowledge_keywords) 内部加入知识K上的K.id = KKW.knowledgeid 其中k.id = 10Select distinct keywordfrom (keywords KWinner Join knowledge_keywords KKW on KKW.keywordid = KW.id)inner Join Knowledge K on K.id = KKW.knowledgeidWhere k.id = 10 这篇关于有关Delphi 7,ADO和&的帮助MS Access SQL语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 14:56