我会直接潜入我的表格,很快我的问题就很明显了
表格1:
Owner ownerID Name Address userID
______________________________________________
Name 1 Tim "top road" 1
表 2:
User userID userName password secretQA1 secretQA2
___________________________________________________________________
1 BigTim pwhat 7 8
表3:
secretQA id question answer
_______________________________________
7 "Mums name" "Tony"
8 "Fav sport" "dressing up"
无论如何,我想做的是我知道 ownerID 是 1,我想给所有者他的所有信息!所以我一直在做的是这样的:
SELECT secretQA.question AS Question1, secretQA.answer AS Answer1,
secretQA.question AS Question2, secretQA.answer AS Answer2,
User.password AS Password
FROM secretQA, owner, User
WHERE owner.id = 1
AND SecretQA.id = owner.secretQA1
AND SecretQA.id = owner.secretQA2
AND user.id = owner.userID;
但无济于事!
这是我想要获得的:
Question1 Answer1 Question2 Answer2 Password
____________________________________________________________
"Mums name" "Tony" "Fav sport" "dressing up" pwhat
为所有未来的帮助干杯
编辑:密码在这里只是一个例子,在我的真实版本中不会是纯文本这只是我在做什么的一个简化问题