我有表a,现工作是把select col001 from a where 条件1的结果填到execl的A列
select col001 from a where 条件2填到execl的B列,以此类推一共有20种条件,现请问能否把这20个条件写到一起一次查询到20列,一次复制到execl里
select col001 from a where 条件2填到execl的B列,以此类推一共有20种条件,现请问能否把这20个条件写到一起一次查询到20列,一次复制到execl里
解决方案 »
- 如何得出以下字符串,请帮忙,谢谢
- 购物网站表的设计
- 在sql server中如何实现 oracle的sequence
- [Microsoft][ODBC SQL Server Driver][SQL Server]用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关联。
- 安装 sql 2008 时出错提示 SQLBrowser”启动请求失败解决办法
- like与in合用的问题?
- 我有一个SQL Server6.5的数据库备份文件(*.dat),有没有人知道我怎样才能将这个数据库还原到SQL Server2000中
- 12道面试的数据库题目,急!!!!!给各大案就行
- SQLServer 时间比较问题,请各位帮忙谢谢了!! n_n
- VFP 编程中发现的一怪现象
- 高手解决,尽量详细
- SQL2000可以附加SQL2005数据库吗?
select id=identity(int1,1) , col002 into tb2 from a where 条件2
......
select id=identity(int1,1) , col020 into tb20 from a where 条件20假设数量一样多.
select tb1.col001,tb2.col002,...tb20.col020
from tb1,tb2,...tb20
where tb1.id = tb2.id and tb1.id = tb3.id ... and tb1.id = tb20.id如果数量不一样多.使用全连接.
select isnull(tb1.col001,null) , isnull(tb2.col002,null) ... , isnull(tb20.col020)
from tb1
full join tb2 on tb1.id = tb2.id
full join tb3 on tb1.id = tb3.id
......
full join tb20 on tb1.id = tb20.id