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

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -