看你的sql是不是从相同日期里面选择一个最小的id出来?
稍微优化一下
select min(a.id) from blogs where a.dayinfo='2008-04-09'你要用变量代替的话那就用拼字符串或者写参数咯
拼字符串如下
String sql = "select min(a.id) from blogs where a.dayinfo='" + date + "'";
稍微优化一下
select min(a.id) from blogs where a.dayinfo='2008-04-09'你要用变量代替的话那就用拼字符串或者写参数咯
拼字符串如下
String sql = "select min(a.id) from blogs where a.dayinfo='" + date + "'";
解决方案 »
- 一个字符抑或多次进行加密是不是没什么意义。
- 谁能告诉我以下几个的区别: InputStreamReader BufferedReader readLine PrintWriter
- jndi配置连接池
- 各位大哥帮帮忙啊!Struts问题:org.apache.jasper.JasperException: Cannot retrieve mapping for action /sign
- 谁有Java Script 操作SVG的资料 + 一个WEB GIS 的问题?
- URL与Socket问题?
- java 到底能做什么!!!
- 求系统解决方案
- EJB里面的钝化是个什么概念!
- spring cglib使用
- 求救:tomcat 报错 提示mysql 连接已经关闭,com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure,这个问题已经缠绕我多天了
- JDBC错误,望指教啊
String sql ="select a.id from blogs a where not exists (select * from message b where a.dayinfo = '"+变量+"' and a.id >b.id)"
String sql = "select top 1 a.id from blogs as a where a.dayinfo='" + date + "'";
String sql ="select top 1 a.id from blogs a where not exists (select * from message b where a.dayinfo = '"+变量+"' and a.id >b.id)"
这是什么原因啊?
String 变量;
String sql ="select top 1 a.id from blogs a where not exists (select * from message b,blogs a where a.dayinfo = '"+变量+"' and a.id >b.id)"