mysql数据库,写:
调取N篇最新文章,然后随机输出请大虾指教!

解决方案 »

  1.   

    select * from (
    select *
    from table1
    order by updatetime desc
    limit 10
    ) t
    order by rand();
      

  2.   

    evanhaha (evanhaha)
      '截至2010-12-01 18:12:21  用户结帖率0.00%当您的问题得到解答后请及时结贴.
    http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
    http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
    http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html8、如何给分和结贴?
    http://community.csdn.net/Help/HelpCenter.htm#结帖
      

  3.   

    不会,因为你的 
    select *
    from table1
    order by updatetime desc
    limit 10
    不过才10条记录,使用order by rand();不会有什么效率上的太大影响。
    updatetime 字段上需要添加索引。
      

  4.   

    多谢!csdn效率真是够高!!结贴!