SELECT id, name, ageFROM usersWHERE age > ? AND age < ?
SELECT id, name, ageFROM usersWHERE age > ? AND age < ?
I'm pretty inexperienced with raw sql, so I have a few questions: 1. The docs show the example of
getUsersByAge(minAge, maxAge)
getUsersByAge(minAge, maxAge)
. How exactly are the variables
minAge, maxAge
minAge, maxAge
mapped to the positional placeholders? is it based on the order that the placeholders appear? 2. What if I want to use a parameter multiple times? Will I have to pass in the parameter multiple times? 3. Is there a way to pass in the parameter, set it to a variable name in the SQL script, and reuse the variable name?