对于
List<News> newsList_random =News.dao.find("select id,title,content,url from news WHERE id >= ROUND(((SELECT MAX(id) FROM news) - (SELECT MIN(id) FROM news)) * RAND()*500 + (SELECT MIN(id) FROM news)) AND id not in ? LIMIT 5",newsIdListQuery);
语句出现如下错误:
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 ''(1266,1559,1764,2154,1512)' LIMIT 5' at line 1
但是我在mysql执行是会出结果的,请教下这是什么问题呢?
注意 not in 后面用好小括号