sql - Extracting data from sub table -
sql - Extracting data from sub table -
i have 2 tables choice(column: id, choice) , choices(column: choice_id, question_id + more).
i need content of selection column plus rest of columns in selection table. tried , several other strings. got nil bot errors. doing wrong?
select * selection id=(select selection choices question=" & request.form("id") & ") order rand()
i can't tell language you're writing in tags specify sql.
it doesn't you're providing entire snippet i'm looking @ have unclosed quotation marks... or something.
additionally, why not bring together on 2 tables rather putting subquery in clause?
from strictly sql perspective, if i'm understanding schema correctly, do:
declare @id int set @id = 42 select c.* selection c inner bring together choices cs on c.id = cs.choice_id cs.question_id = @id
sql
Comments
Post a Comment