关于追加查询记录集的问题

haodez 2006-12-29 03:44:33
我用asp返回了一个记录集set oRS=oCn.execute("select companyName from tbl_company where companyName like '%abc%'")

因为查询的表有所变化,现在要在oRS的基础上追加一个记录集"select companyName from tbl_companyBranch where companyName like '%abc%'"

高手可能看出来了,最初的数据库设计有些问题,但是我也没办法,刚接手,想追加一个记录集来解决这个问题。

应该如何实现呢?
...全文
90 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
haodez 2006-12-29
  • 打赏
  • 举报
回复
问题解决!多谢楼上各位!
marco08 2006-12-29
  • 打赏
  • 举报
回复
用 UNION ALL 聯合兩個結果集
marco08 2006-12-29
  • 打赏
  • 举报
回复
--try

set oRS=oCn.execute("select companyName from tbl_company where companyName like '%abc%' union all
select companyName from tbl_companyBranch where companyName like '%abc%'")
冷箫轻笛 2006-12-29
  • 打赏
  • 举报
回复
set oRS=oCn.execute("select companyName from tbl_company where companyName like '%abc%' union all select companyName from tbl_companyBranch where companyName like '%abc%'")

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧