您的位置:首页 > 产品设计 > UI/UE

MySQL_Table_Union_Query_Alias

2016-05-05 00:00 375 查看
摘要: Union -- Union all -- Alias

1. Union

select id from t_book;
select id from t_bookType;
select id from t_book union select id from t_bookType;




2. Union all

select id from t_book union all select id from t_bookType;




3. Alias

select * from t_book tb where tb.id>=3;
select tb.id, tb.bookName from t_book tb where tb.id>=3;
select tb.id, tb.bookName Book_Name from t_book tb where tb.id>=3;
select tb.id, tb.bookName as Book_Name from t_book tb where tb.id>=3;




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: