討論串[SQL ] 同一資料表內之查詢
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者carlcarl (carl)時間13年前 (2012/10/06 21:48), 編輯資訊
0
0
1
內容預覽:
如果有個 7 乙 f n3. 這個query會有問題. group by的後面應該多加個a.manufactures. 然後order再改一下. 變成. select a.* from product a. inner join product b on a.manufactures=b.manuf
(還有33個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者hukhuk (ken)時間13年前 (2012/10/06 11:37), 編輯資訊
0
0
0
內容預覽:
select a.* from product a. inner join product b on a.manufactures=b.manufactures. where a.company<>b.company. group by a.company. order by a.manufactu

推噓1(1推 0噓 1→)留言2則,0人參與, 最新作者icydream (巧虎)時間13年前 (2012/10/06 10:32), 編輯資訊
0
0
1
內容預覽:
(test為資料表名稱). select b.序號,. b.公司,. b.承辦人,. b.產品. from (select 產品. from test. group by 產品. having count(*) > 1) as a. inner join (select t2.序號,. t2.公司,
(還有591個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者dauntless (火車呼嚕呼嚕)時間13年前 (2012/10/06 08:14), 編輯資訊
0
0
0
內容預覽:
資料表如下:. 序號 公司 承辦人 產品. 1 甲 a n1. 2 乙 b n2. 3 丙 c n3. 4 乙 d n2. 5 戊 e n1. 6 已 u n2. 若要查詢所有不同公司,但卻使用相同產品. 的紀錄:如下。. 1 甲 a n1. 5 戊 e n1. 2 乙 b n2. 6 已. d n
首頁
上一頁
1
下一頁
尾頁