我在 sql 中有 3 个表,如下所示:(需要 sql 语法)
1
.xy8vx_users
-username
-email
-....
2
.xy8vx_rsform_submissions
-SubmissionId
-Username
-...
3
.xy8vx_rsform_submissions_values
-SubmissionId
-FieldName
-FieldValue
-...
我想得到:
xy8vx_users.username, and xy8vx_users.email
,满足条件
submission_values.FieldName = 'data2' AND submission_values.FieldValue = '10.03.2012'
我已经花了 2 个小时,没有人可以帮助我吗?
我试过这个:(但不工作)
SELECT sub.Username
FROM `xy8vx_rsform_submission_values` AS value
JOIN `xy8vx_rsform_submissions` AS sub ON value.SubmissionId = sub.SubmissionId
JOIN xy8vx_users ` AS users ON sub.Username = users.email WHERE value.FieldName = 'data2' AND value.FieldValue = '10.03.2012'`