dongmei2351 2013-08-15 11:29
浏览 7
已采纳

从Mysql数据库列中获取最高价值[关闭]

I have a database "videos". Which has a table for each video i.e "ID" "Name" "Link" "Count". i want to be able to take the highest value of any of the tables from the column "Count" and then use which ever has the highest values "Link" Column.

So the best way i can explain is i'm trying to make a "Most Viewed" part of my site so which ever has the highest hit count gets displayed via $row['link'].

Hope this made sense didn't much to me!

Thanks all in advance...

  • 写回答

2条回答 默认 最新

  • doubi8383 2013-08-15 11:33
    关注
    SELECT `link` FROM `someTable` ORDER BY `Count` DESC LIMIT 1
    

    This will give you the link of the row with the highest count.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理
  • ¥15 STM32无法向设备写入固件
  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果