java - Incorrect syntax near the keyword «JOIN» -
please, me find error. checked in sqlserver , good. netbeans giving error: "incorrect syntax near keyword" join "»
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' , '2015-06-12' , goods.id = 1"; resultset rs = stmt.executequery(query);
try adding spaces @ beginning or end of strings you're concatenating:
string query = "select sale.date_sale, cheque.quantity, goods.price, cheque.quantity*goods.price" + " sale join cheque on sale.id = cheque.id_sale join goods on goods.id = cheque.id_goods" + " sale.date_sale between '2001-04-12' , '2015-06-12' , goods.id = 1";
Comments
Post a Comment