Hallo @ll,
ich schreibe in java eine SQL Abfrage bzw. mehrere sql Abfragen.
und kriege folgende Exception:
org.postgresql.util.PSQLException: ERROR: syntax error at or near “=”
...
getOutput(int param){
...
String sql_avg_rates = "select tag_id, avg(rating) from ratings"+
"where uid = "+param+" group by tag_id";
ResultSet res=stmt.executeQuery(sql_avg_rates);
result = res.getString(1);
...
ouput result;
}
Dabei wird param als Parameter in die Funtion gegeben: getOutput(int param)
Weiss jemand woran das liegt? mit like geht es auch nicht…
Vielen Dank im Voraus…
lg,
hugo