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

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -