易截截图软件、单文件、免安装、纯绿色、仅160KB

【SOS】 MSSQL数据库问题 - MS-SQL Server / 疑难问题

select id,name,type from A union all 
select id,name,type from B union all 
select id,name,type from C union all where ???
----------------------------------------------------
 1,张三,会员
 2,李四,钻石
 7,王五,普通
 3,张三,会员
 5,张三,会员
---------------------------------------
 查询时 “会员” 的用户列 
  Where 后面怎么写。。。
  type='会员' 不行


成功后 即结贴。。。。。。。。。。。。。

A.type = '' or B.type='' or C.type=''


先结帖再试吧

引用
A.type = '' or B.type='' or C.type=''

  都要写吗?
  我又多张表

SQL code:
select id,name,type from A where [TYPE]='会员'
union all
select id,name,type from B where [TYPE]='会员'
union all
select id,name,type from C where [TYPE]='会员'


select * from(
select id,name,type from A union all  
select id,name,type from B union all  
select id,name,type from C) t where type='会员'

引用
SQL code
SELECT * from (
select id,name,type from A union all
select id,name,type from B union all
select id,name,type from C
)T where [TYPE]='会员'

  T是


相关问答:

求一sql语句 - MS-SQL Server / 疑难问题

现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......

求一个SQL语句 - MS-SQL Server / 基础类

字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......

SQL语句问题 - MS-SQL Server / 疑难问题

请教高手:
 以下是数据库中的三条记录,英文为字段名称  
  id planname TaskBeginTime Status
329 2010年03 ......

mysql区没高手 - MS-SQL Server / 基础类

我觉得mysql和sqlserver有共同的地方:
有个问题是关于表的锁问题:
进程A 进程B
select * from user where id in lock share mode(共享锁)
&nb ......

sql语句问题 - MS-SQL Server / 疑难问题

现在有一个部门表dept(部门名称,部门号。。)有一个人员表emp(姓名,人员编号,职位,薪资,部门)
emp表中的内容是这样的:
a 1 工程师 3000 软件部
b 2 普通员工 2000 硬件部
c 3 工程师 4000 硬件部
d ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号