mysql not reverse sorting datetime field correctly -
i trying sort datetime field in descending order. sorting day fine. however, time part random. sorts in ascending order perfectly.
sample query:
select * pcvisit page_id='0005e1ca1784383bf6bf032f33dc6e27' order dtime desc
result:
4adbc6b1cab4f14e7c9f2e308eb0944e | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 16:08:35 | 1 733ab6507fbdab0e71f357f2f0ff6067 | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 07:24:12 | 1 a5f9c9810e9648d2dbe4dec0e785216c | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 05:26:59 | 1 981e24b4dd257f44a7a41dbdfe4def54 | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-22 09:07:12 | 3 67906b350d59e97d7f56b7ceb254857e | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-22 06:55:44 | 1
i have tried:
select * pcvisit page_id='0005e1ca1784383bf6bf032f33dc6e27' order dtime desc, time(dtime) desc
trying best not have split 2 fields.
the date , time being sorted correctly. closer. when day changes 22nd, time starts @ top again, , starts descending. descending date first, time.
Comments
Post a Comment