作者pakker (找尋蔚藍天空)
看板Database
標題Re: [SQL ] 請問從五個資料表內抓最新的五筆SQL怎麼下
時間Thu Nov 1 22:01:47 2007
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.121.23.85
※ 編輯: pakker 來自: 59.121.23.85 (11/01 22:21)