有三个表A,B,C,都有字段1和字段2,要求查询三个表,把所有满足‘字段2>K'的字段1查询出来,该怎么写啊?/
解决方案 »
- 深夜请教一个关于触发器的问题
- SQL2000 订阅复制的问题
- 数据库-sqlserver2005中执行delete语句后如何恢复
- 问一个小问题,随便散分!
- 再发 ~~~~~交叉表的问题
- 急请高手指点,未能启用约束。一行或多行中包含违反非空、唯一或外键约束的值[问题点数:50分]
- The database 'model' is marked RESTORING and is in a state that does not allow r
- access之Select first(vtime) as vfirst from [view]如何改为sqlserver的语句^_^
- 上帝啊,救救我吧!
- 这二天在看70-228书籍,有个概念不大清楚,请问何为sql server自动化多服务器,有和用处.
- 求教:按时间段查询时碰到一个新问题,请大家帮帮忙?
- SQL SERVER2000 7411错误
(
select 字段1,字段2 from A
union all
select 字段1,字段2 from B
union all
select 字段1,字段2 from C
)A
where 字段2>K
select distinct 字段1 from
(
select distinct 字段1 from a where 字段2>k
union
select distinct 字段1 from b where 字段2>k
union
select distinct 字段1 from c where 字段2>k
)
中的表1是自动生成的还是要先建一个???
drop table [dbo].[表1]
GO