[SQL ] postgreSQL的limit
不好意思又來發問..
postgreSQL的limit + order by可以拿來取前幾名
比如說我要以"獲獎次數"當作排名依據
表如下
<name> <times>
David 4
Merry 2
Terry 5
Billy 4
Tom 2
John 1
而postgreSQL取前三名的語法(SELECT * FROM table ORDER BY times limit 3)卻出現...
<name> <times>
Terry 5
David 4
Billy 4
有什麼辦法可以讓名次重複嗎?
就是產生如下的結果
<name> <times>
Terry 5
David 4
Billy 4
Merry 2
Tom 2
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.31.183
推
06/07 11:59, , 1F
06/07 11:59, 1F
→
06/09 00:27, , 2F
06/09 00:27, 2F