如何在SQL Server中比较两个结果集 [英] How to Compare two result sets in sql server

查看:400
本文介绍了如何在SQL Server中比较两个结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai ALL

我有一个具有以下结构的表
表格名称
字段是:

software_id primaryKey
version_id FK
software_name是varchar

我已经在表中存储了详细信息

我需要比较两个版本

从版本= 1的软件中选择software_name

从版本= 2
的软件中选择software_name
这两个查询应为

版本1以外的软件
不是版本1中的软件

Hai ALL

I have a table with the following structure
table name
Fields are:

software_id primaryKey
version_id FK
software_name is varchar

I have stored detials in the table

I need to compare two versions

select software_name from software where version =1

select software_name from software where version =2

These two queries should give the

sofware that is not in verion 1
Sofware that is was not in version 1

推荐答案

如果您要比较复杂的架构,则可以使用datacompare工具中的一个
http://www.devart.com/dbforge/sql/datacompare/ [ http://www.starinix.com/sqlcompare01.htm [
You can use on of the datacompare tools if you are comparing complex schemas
http://www.devart.com/dbforge/sql/datacompare/[^]

http://www.starinix.com/sqlcompare01.htm[^]

There are tons of other tools, if you are trying to solve a complex comparision.

otherwise, you can simply load data into datasets and compare them using code. Its much easy to do so.


这篇关于如何在SQL Server中比较两个结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆