討論串[SQL ] 要怎麼count ?
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者ClubT (We will Wii)時間16年前 (2008/07/15 14:25), 編輯資訊
2
0
1
內容預覽:
我是用SQL Server2000. 現在有一個TABLE有3個欄位. Field1 Field2 Field3. =============================. aaa bbb 111. aaa ccc 123. aaa bbb 222. ddd ccc 234. aaa ccc 5
(還有419個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者aleck945 (總是不知所措)時間16年前 (2008/07/15 14:55), 編輯資訊
0
0
0
內容預覽:
可以參考 2254 編.. SELECT *. FROM ur_table t1. WHERE (SELECT count(*). FROM ur_table t2. WHERE t2.field1=t1.field1 and t2.field2=t2.field2) > 1. ORDER BY t

推噓3(3推 0噓 0→)留言3則,0人參與, 最新作者ruby0104 (:))時間16年前 (2008/07/15 14:56), 編輯資訊
0
0
0
內容預覽:
select a.f1,a.f2,a.f3 from table a,(select f1,f2 from table group by f1,f2. having count(*)>1) b. where a.f1=b.f1 and a.f2=b.f2. --. 發信站: 批踢踢實業坊(ptt
首頁
上一頁
1
下一頁
尾頁