Checked in a DBMS - everything works out normally. NetBeans gives the error:

Invalid syntax around „JOIN“

Request Code:

String query = "SELECT Sale.date_sale, Cheque.quantity, Goods.price, Cheque.quantity*Goods.price" + "FROM Sale JOIN Cheque ON Sale.id = Cheque.id_sale JOIN Goods ON Goods.id = Cheque.id_goods" + "WHERE Sale.date_sale BETWEEN '2001-04-12' AND '2015-06-12' AND Goods.id = 1"; ResultSet rs = stmt.executeQuery(query); 

    1 answer 1

    At first glance, the problem is in concatenation. You have no space, for example here:

     Goods.price" + "FROM Sale 

    It is necessary so:

     Goods.price " + "FROM Sale 

    Or so:

     Goods.price" + " FROM Sale 

    Same here:

     Cheque.id_goods" + "WHERE 
    • You're right, thank you) - Riki Tiki
    • Itself about such a rake stumbled more than once. :) - SlyDeath