Re: [SQL ] 請問從五個資料表內抓最新的五筆SQL怎麼下

看板Database作者 (Nerding)時間18年前 (2007/11/03 13:35), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/7 (看更多)
抄的...XD select * from ( (select * from boards where board_name = '1' order by posttime limit 5) union (select * from boards where board_name = '2' order by posttime limit 5) union (select * from boards where board_name = '3' order by posttime limit 5) union (select * from boards where board_name = '4' order by posttime limit 5) union (select * from boards where board_name = '5' order by posttime limit 5)) order by posttime limit 5; 這樣? ※ 引述《pakker (找尋蔚藍天空)》之銘言: : select * from ( : (select * from board1 order by posttime limit 5) union : (select * from board2 order by posttime limit 5) union : (select * from board3 order by posttime limit 5) union : (select * from board4 order by posttime limit 5) union : (select * from board5 order by posttime limit 5) union : ) AS U order by posttime limit 5; : 這樣? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.36.135.64
文章代碼(AID): #17B0YAJv (Database)
討論串 (同標題文章)
本文引述了以下文章的的內容:
以下文章回應了本文
完整討論串 (本文為第 6 之 7 篇):
文章代碼(AID): #17B0YAJv (Database)