From: http://my.oschina.net/ulyn/blog/160520 Click Open link
Recently, when I wrote a list component ulynlist, I found a problem in this record.
Today, List component tuning, I tried to cut down the number of each piece, each page, just completed a footer plug-in time, very happy to point, suddenly point to 10 fishes when found how always is that piece of data, thought is the front-end plug-ins write a problem. After looking at the next console SQL, cut out the SQL to execute, found that is true, from 9 to 13 are the same record.?
1 2 3 |
SELECT * FROM (select A.*, RowNum RN from (select t.* to t_car_info t WHERE t.del= ' 0 ' and t.id = ' 00 3 ' ORDER by create_time Desc) A where rownum <= where RN >= 10 |
Normally, this SQL is very difficult to find any problem, in general, our small flow system This create_time is often the only, so it is really difficult to find.
I use Create_timedesc to sort, but the value of this field is copied and pasted because it is a database record, and many records are the same value. This is a typical order by field value that does not uniquely cause paging records to clutter
How to solve it. In fact, it is very simple, as long as in the sort of time to add a unique value of the field on it. Preferably the ID. Change to find out that everything is OK:
?
1 2 3 |
SELECT * FROM (select A.*, RowNum RN from (select t.*) from |