Answer the question
In order to leave comments, you need to log in
Why placeholder parameters don't work everywhere?
I did not really understand which tag this question should be attributed to, either to postgres or go. Why doesn't this work?
SELECT * FROM chtoto WHERE $1=$2 LIMIT 1
but this works
SELECT * FROM chtoto WHERE id=$1 LIMIT 1
with order by even sadder, you have to do this:
fmt.Sprintf("SELECT * FROM chtoto WHERE id >= $1 ORDER BY %v %v, id %v LIMIT $2 + 1", one, two, two)
SELECT * FROM chtoto WHERE 'id'='513135513315' LIMIT 1
Answer the question
In order to leave comments, you need to log in
Because instead of $1, $2, etc. values should be substituted, not column names
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question