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