MySQL多个相同结构的表查询并把结果合并放在一起的语句(union all)
生活随笔
收集整理的這篇文章主要介紹了
MySQL多个相同结构的表查询并把结果合并放在一起的语句(union all)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
union all
select * from table1001 where price > 10 union all select * from table1002 where price > 10 union all select * from table1003 where price > 10 order by ID列的個數要保持一致,列名可以不一樣,但是對應的列的數據類型要一樣。同樣可以使用order by,limit這些。
?
參考:
http://bbs.51cto.com/thread-1076108-1-1.html
總結
以上是生活随笔為你收集整理的MySQL多个相同结构的表查询并把结果合并放在一起的语句(union all)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基础交换
- 下一篇: SpringMVC的Controller