I got problem for using the bindValue in QT with SQLite3. The below statement don't work.The exec is success but result incorrect.
query5.prepare("select DISTINCT :col_readback FROM Equipment");
query5.bindValue(":col_readback", "Category");
However, if I run the below one statement without any issue.
query5.prepare("select DISTINCT Category FROM Equipment");
I have tried to change to another name of the bindValue but it don't work as well.
Edited out the original answer so the first comment makes no sense now.
Given that you are trying to substitute a column name vs. a value, I would suggest that you simply build the query string and then execute it, skipping the prepare.