我有两张表,一张是这两张表的Subjects和UserDetails 列:
Subjects
(RegNo,IndexNo,Subject_1,Subject_23,Subject_3,Subject_4) 和UserDetails
(姓名、出生日期、注册号、地址、ID)
我想根据特定主题从主题中获取、、、、和Name
索引。我创建了一个查询,但它不起作用_主题是包含主题名称的字符串变量DOB
RegNo
Address
ID
UserDetails
SELECT UserDetails.Name,UserDetails.DOB,
UserDetails.RegNo,UserDetails.Address, UserDetails.ID,
Subjects.IndexNo
FROM UserDetails
INNER JOIN Subjects ON UserDetails.RegNo = Subjects.RegNo
WHERE Subjects Subject_1
OR Subject_2
OR Subject_3 OR Subject_4 ='"+_subject+"'"