UNION 排除重复行
union all 不排除
select bl_student_id from books_loaned
union
select reserved_student_id from books_reserved;
union all 不排除
select bl_student_id from books_loaned
union
select reserved_student_id from books_reserved;
解决方案 »
- 数据库查询结果数据为0转换成1
- select * from student where studentNumber like '%值%'"
- 求句SQL语句.......................崩溃的边缘
- 求相关新闻的SQl?
- 一个SQL Server 2000的问题
- SQL求助--->两表之间统计数量
- 怎样把一个查询结果存储到一个临时表中去
- 我公司长年招聘兼职程序员(熟悉 sql server\delphi or vb or pb) 大连地区。
- 急!SQL初学,一个查询的select语句
- 我在命令模式下关闭Oracle时,出了问题。请各位高手帮忙!!!
- 关于datetime
- 哪里有ORACLE FOR UNIX的下载!!!!!!!!!!!!!(免费的)
select field1 a,field2 b from tablea
union
select field2 a,field2 b from tableb
union 起来的多个select 语句中不能含有order by
union all!楼上的大虾又犯错了:union可以使用order by
在union连接的select 语句中,只能是最后一个可以用order by
不是union all吧.