当前位置: 技术问答>java相关
一个关于SQL语句的小问题,很急的问,大家帮忙看看!谢了先!
来源: 互联网 发布时间:2015-01-27
本文导语: String squery="select orderid, goods_name, goods_address, goods_company, goods_price, buy_number,buy_sum from "+Constant.order_db+" where userid='"+input_text+"' and cust_id like '"+input_text+"%'"+" order by orderid"; System.out.println("search query: "+squery); ...
String squery="select orderid, goods_name, goods_address, goods_company, goods_price, buy_number,buy_sum from "+Constant.order_db+" where userid='"+input_text+"' and cust_id like '"+input_text+"%'"+" order by orderid";
System.out.println("search query: "+squery);
运行结果:
search query: select orderid,goods_name,goods_address,goods_company,goods_price,buy_number,
buy_sum from order where userid='jmy' and cust_id like 'jmy%' order by orderid
出现一个错误:*** SQLException caught ***
SQLException: [Microsoft][ODBC Microsoft Access Driver] FROM 子句语法错误。
System.out.println("search query: "+squery);
运行结果:
search query: select orderid,goods_name,goods_address,goods_company,goods_price,buy_number,
buy_sum from order where userid='jmy' and cust_id like 'jmy%' order by orderid
出现一个错误:*** SQLException caught ***
SQLException: [Microsoft][ODBC Microsoft Access Driver] FROM 子句语法错误。
|
order 是关键字,不能做表名
|
from [order ]
|
表结构象什么样?最好给出来