使用java访问查询

时间:2014-04-12 13:26:33

标签: java ms-access

所以我有表CodeSection中的Professeur字段,并尝试从表Nom中获取字段Software

我的DB就是这样:

Hum ...apparently I don't have enough reputation to post a picture ... I can send it to you by message

我的查询如下:

String query ="SELECT Software.Nom 
        FROM Software
        WHERE Software.CodeSoftware = UtilisationSoftware.CodeSoftware 
        AND UtilisationSoftware.IdAnneeEtude = AnneeEtude.IdAnneeEtude 
        AND AnneeEtude.CodeSection = '" + codeSection + "'";

codeSection是一个字符串

但问题仍然存在于查询中

1 个答案:

答案 0 :(得分:0)

您的SELECT语句需要具有FROM关键字:

SELECT <...> FROM <...> WHERE <...>

从部分应包含表名,从中选择日期