看板 Database 關於我們 聯絡資訊
只要path 是/eorder開頭且id相同的只取一筆的數量有多少 table: path id ------------------------------------ /eorder/step1.asp 190471982 /news/combo.asp 190472310 /index.asp 190472325 /index.asp 192491668 /hotcard/sale.asp 192491665 /eorder/step1_delco.asp 190471982 /eorder/step1.asp 192491315 /menu/new.asp 190472209 例如 : 都是/eorder開頭的資料 /eorder/step1.asp 190471982 /eorder/step1_delco.as 190471982 /eorder/step1.asp 192491315 但前兩筆的id相同 所以數量為=2 怎麼下SQL 語法呢?? 謝謝 我知道可以由substring(path,1,7)='/eorder' 取出/eroder開頭的資料 select count(path) 其他的就不知道該怎麼處理了 有人會的嗎?請指教一下 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.70.165.248
Antzzz:select count(distinct id) from 表 where 選擇條件 03/15 20:46
ginzu:會了~謝謝囉 03/17 21:46