select (
select A,B
from table_a
where condition_a
)
,
(
select C,D
from table_a
where condition_b
)
from table_a
where condition_a and condition_b非常感谢
select A,B
from table_a
where condition_a
)
,
(
select C,D
from table_a
where condition_b
)
from table_a
where condition_a and condition_b非常感谢
解决方案 »
- (急)如何获取数据库的datetime值的年月日值
- 这种查询语句怎么写?
- 怎么在数据库中筛选出和时间最靠近的记录呢?
- 新手求助:这个作业怎么写?
- 链接数据库出错:provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接
- 查询出来的ID执行存储过程
- sql server用函数生成字段默认值的小问题
- 也问sql server中datatime问题
- 大家好,我刚到公司上班这里数据库都用sql server,不知道能不能介绍几本好书给我。
- 请教高手!
- 做一个sql语句,根据公司名称生成公司的城市信息,填写到公司住信息的城市栏中。
- 怎样把负号显示在数字后面
如果select子查询只返回一列的话,也可以被 in,not in 引用.
单是子查询放到select后面,是错误的写法.
select (select top 1 a from t_a),...
这样是可以的
select (select a from t_a) ,...
如上,只引用一列但不唯一,也是不可以的.
这样是可以的.