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.
 
-----Original Message-----
From: Halil AKINCI [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 8:38 AM
To: [EMAIL PROTECTED]
Subject: sql statement

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 ";

Reply via email to