Answer the question
In order to leave comments, you need to log in
How to generate sql query?
I have a Poll table, I have an Answer table, each record of which is associated with a poll by PollID, that is, the poll has several answers, and there is a Voice table that contains links to users in the User table (to know who voted) and to the answer is in the answer table. Here I need to check whether the current user voted in this poll. Please tell me how to create a request
Answer the question
In order to leave comments, you need to log in
do consecutive Join. But for this problem, you can do a little cropping
select г.userId from Ответ as o
INNER JOIN Голос as г ON г.ОтветId = о.Id
WHERE o.Опросid = something AND г.UserId = something
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question