1
回答
You have an error in your SQL syntax;
开发十年,就只剩下这套Java开发体系了   

String sql = "SELECT DISTINCT t_order.contract_num AS CONTRACTNUM, t_order.contract_date AS CONTRACTDATE,"
                + "t_ordcontracts.ocont_total AS OCONTTOTAL, t_order.emp_name AS EMPNAME, t_customer.cus_name_zh AS CUSNAMEZH,"
                + "t_order.region AS REGION, t_order.ord_num AS ORDNUM FROM t_order INNER JOIN t_customer ON ("
                + "t_order.cus_id = t_customer.id) INNER JOIN t_project ON (t_project.ord_id = t_order.id) "
                + " LEFT JOIN t_protask ON (t_protask.ord_id = t_order.id) LEFT JOIN t_staff ON (t_protask.pt_perid = t_staff.id)"
                + " LEFT JOIN t_invoices ON (t_invoices.cus_id = t_customer.id) LEFT JOIN t_ordcontracts ON ("
                + "t_ordcontracts.cus_id = t_customer.id) LEFT JOIN t_language ON (t_order.tran_id = t_language.id)"
                + " LEFT JOIN t_receivables ON (t_order.contract_num = t_receivables.ocont_num) LEFT JOIN t_employe e ON ("
                + "t_order.emp_id= e.id) where t_order.delflag = false";

 

 

这是拼接的sql。   请指教

错误:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''SELECT DISTINCT t_order.contract_num AS CONTRACTNUM, t_order.contract_date AS C' at line 1

我打印出来的sql在MYSQL中可以运行。 

 

 

<无标签>
举报
frank_Wf5
发帖于1年前 1回/73阅
顶部