ChinaUnix.net
相关文章推荐:

mysql 重复数排序

4 下 select dp_id,count(dp_id) as d from user group by dp_id order by d desc; 5 下可以使用 select dp_id from user group by dp_id order by count(dp_id) desc; 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8780/showart_298878.html

by linxh - MySQL文档中心 - 2007-05-11 21:06:43 阅读(942) 回复(0)

相关讨论

表结构字段及表的内容为 id userid usertype other 1 2 1 ... 2 2 1 ... 3 2 9 ... 4 8 3 ... 5 9 4 .... 6 8 3 .... ............... 这个表结构字段userid与usertype应该是唯一索引,但忘了设置了,现在已经有超过100万条数据 再重新设置唯一...

by 火鸡 - MySQL文档中心 - 2007-08-14 14:51:30 阅读(1079) 回复(0)

比如数据表中有字段id,分别有a1到a29的字符,如果查询时加入"order by id",排序会是a1,a10,a11...a19,a2,..a29,a3,a4...a9这样 怎样可以让它以a1,a2,a3....a28,a29这样排序输出呢?

by failsafe - PHP - 2012-09-08 11:13:30 阅读(2544) 回复(7)

mysql排序问题 本人做一项目排序页面 项目的ID按指定次序存放如:23,1,5,3 现用where id in ( 23,1,5,3) 取记录 如何时做到该记录的次序也按 23,1,5,3 来排序

by jumpbull - MySQL - 2005-05-10 17:58:33 阅读(869) 回复(0)

我在网上看到 SELECT * FROM `table` ORDER BY NEWID() 可以随机排序 我用了但出错 可能对能针对MS SQL SERVER 那 mysql 中如何实现

by jummpbull - PHP - 2004-10-06 11:05:45 阅读(4021) 回复(5)

各位大侠,今天遇到一个问题, SSH 到Freebsd 4.9的服务器上,进入mysql 里,不小心执行了: delete from a,把表A的数据全删了, 请问各大侠,有什么方法可以找回数据?(极重要。等待中!)

by imagecoco - MySQL - 2004-04-23 20:59:29 阅读(1041) 回复(2)

表结构如下: mysql> select * from test; +----+-------+ | id | name | +----+-------+ | 1 | test1 | | 2 | test2 | | 3 | test3 | | 4 | test4 | | 5 | test5 | +----+-------+ 执行以下SQL: mysql> select * from test where id in(3,1,5); +----+-------+ | id | name | +----+-------+ | 1 | test1 | | 3 | test3 | | 5 | test5 | +----+-------+ 3 rows in set (0.00 sec) 这个select在mysql中得结果会自动按照...

by nj-racoon - PHP - 2007-03-21 14:12:30 阅读(3814) 回复(3)

表结构如下: mysql> select * from test; +----+-------+ | id | name | +----+-------+ | 1 | test1 | | 2 | test2 | | 3 | test3 | | 4 | test4 | | 5 | test5 | +----+-------+ 执行以下SQL: mysql> select * from test where id in(3,1,5); +----+-------+ | id | name | +----+-------+ | 1 | test1 | | 3 | test3 | | 5 | test5 | +----+-------+ 3 rows in set (0.00 sec) 这个select在mysql中得结果会自动按照...

by nj-racoon - MySQL - 2007-03-21 14:18:37 阅读(2069) 回复(1)

例如: select Id from Info where Id order by Id; +----------+ | Id | +----------+ | 10001 | | 100010 | <---这里.如果按我的设想.这句应该排到最后面.请问要如何解决这 | 10002 | 个问题? 谢谢. | 10004 | +----------+

by Qlin - MySQL - 2006-04-14 11:40:29 阅读(1624) 回复(8)

重复记录如下: 请问该如何删除。

by apple13212 - MySQL - 2009-01-08 11:35:09 阅读(2208) 回复(7)

create temporary table tmp select * from your_talbe group by rep-field order by id; truncate your_table; insert into your-table select * from tmp order by id; drop table tmp; 其中,rep-field为要删除的重复字段 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/24020/showart_432826.html

by elong21 - MySQL文档中心 - 2007-11-29 15:23:43 阅读(824) 回复(0)