Microsoft Access查询生成表的SQL

Microsoft Access查询生成表的SQL

问题描述:

有人能告诉我什么是错我的where子句中的这一说法在访问SQLMicrosoft Access查询生成表的SQL

SELECT * INTO [Enrolled Students] 
    FROM [Candidate Details]; 
    Where Student ID != 'rejected' OR 'pending' OR 'taster'; 

或者,如果可能的话,可以将其修正为,其中则IsNumeric(学生证)?

我仿佛看不出来

谢谢!

SELECT * INTO [Enrolled Students] 
    FROM [Candidate Details] 
    Where [Student ID] not in('rejected', 'pending' ,'taster'); 
+0

谢谢!做到了! 另一个问题 我认为这样做会自动填充我的表,每次我进入一个人到原来的表,但它要我重新运行查询 有没有办法自动做到这一点? – Sawyer05 2012-07-31 11:28:41

+0

5分钟编辑间隙可能非常有用。 – Fionnuala 2012-07-31 12:20:34

在MS Access

SELECT * INTO [Enrolled Students] 
    FROM [Candidate Details] 
    Where [Student ID] Not IN ("rejected","pending","taster"); 

看来,学生ID是一个文本字段,如果它可以是 “拒绝”。不在IS在这种情况下,更方便,否则你不得不说:

Where [Student ID] <> "rejected" And [Student ID] <> "pending" <...> 
+0

user1534524这不是一个好主意,不断运行生成表查询。首先,它会导致数据库膨胀。你为什么觉得你需要这样做? – Fionnuala 2012-07-31 12:26:20