|
I'd
rather say that the error is that you must change
WHERE TaxNnumber=tno
with
WHERE TaxNnumber="+tno+"
"tno" is a java
string. How would the database know that ;)
/Mattias
Just
on the surface, the problem seems to be that your group by statement
references columns that are not in your select...Fname instead of FirstName
for example. The where statement looks fine unless tno is a string in which
case you need to put single quotes around it.
Hi,
I have a servlet that gets a parameter from a
HTML form and execute a query. But my sql statement incorrect. I think
following red part should be changed.
Can anyone check it?
-------------------------------------------------------------------------
.
.
String tno =
request.getParameter("vergi_numarası");
.
.
.
String sql="SELECT FirstNname, LastName,
TaxNumber, SUM(Debt) As Total FROM "
+
"Arsa_beyan WHERE
TaxNnumber=tno GROUP BY TaxNumber, Fname, Lname
";
|