sql - How to return results from multiple tables -
i have 2 tables quiz application:
[questions] _id, question, correctanswerid [answers] _id, answer, questionid
when query question, e.g.
select question questions _id = 2
i want (correct , incorrect) answers associated question. how can query question , answers @ once don't have query answers separately?
use join
:
select q.question, a.answer questions q join answers on q._id = a.questionid q._id = 2
Comments
Post a Comment