源数据
id uid names fieldValues
1 1 imageName 1111
2 1 publicDate 2004-1-1
3 2 imageName 2222
4 3 imageName 333
5 2 publicDate 2006-1-1
6 3 publicDate 2005-1-1
写一条查询,要案日期排序就变成注意,UID必须是连继的
id uid names fieldValues
2 1 publicDate 2004-1-1
1 1 imageName 1111
6 3 publicDate 2005-1-1
4 3 imageName 333
5 2 publicDate 2006-1-1
3 2 imageName 2222
请问有没有方法!,,有的话,在Mysql中如何写
id uid names fieldValues
1 1 imageName 1111
2 1 publicDate 2004-1-1
3 2 imageName 2222
4 3 imageName 333
5 2 publicDate 2006-1-1
6 3 publicDate 2005-1-1
写一条查询,要案日期排序就变成注意,UID必须是连继的
id uid names fieldValues
2 1 publicDate 2004-1-1
1 1 imageName 1111
6 3 publicDate 2005-1-1
4 3 imageName 333
5 2 publicDate 2006-1-1
3 2 imageName 2222
请问有没有方法!,,有的话,在Mysql中如何写
from 表名
group by uid,fieldValues
order by TO_DAYS(fieldValues)
from 源数据 a ,源数据 b
where a.uid=b.uid
and b.names='publicDate'
order by b.fieldValues ,a.names desc