Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. select * from questions
  2. left join responses on responses.QuestionId = questions.id
  3. where responses.username <> 'username string' or responses.username is null
  4. order by rand() limit 1;
  5.  
  6. _sequelize.query(
  7. 'select * from questions ' +
  8. 'left join responses on responses.QuestionId = questions.id ' +
  9. 'where responses.username <> "' + req.query.name + '" or responses.username is null ' +
  10. 'order by rand() ' +
  11. 'limit 1',
  12. {model : models.Responses})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement