how to determint wether two column equals
question:
How to determint wether two column equals?
Answer:
Table one:RecordId = 1,CommonId = 5,Approved = 1.
RecordId = 2,CommonId = 5 Approved = 0.
Table two:RecordId = 4,CommonId = 9,Approved = 1.
case one:if you are compare in the one table.
you can use the following code
select commonId,
(case when max(Approved) = min(Approved) then else end) as IsEqual
from MyTable A
group by commonId;
case two:if you are compare in the two tables.
you can use the following code.
SELECT
CASE
WHEN (A.Approved = B.Approved) THEN
ELSE
END
FROM MyTable A,
MyTable B
WHERE A.commonId = B.commonId;
Note:you need modify condition A.Approved = B.Approved only ,in compare two tables different column.
how to determint wether two column equals的更多相关文章
- jdbcTemplate的Dao层封装
package com.easyrail.base.dao; import java.io.Serializable; import java.lang.reflect.Field; import j ...
- Java学习笔记之使用反射+泛型构建通用DAO
PS:最近简单的学了学后台Servlet+JSP.也就只能学到这里了.没那么多精力去学SSH了,毕竟Android还有很多东西都没学完.. 学习内容: 1.如何使用反射+泛型构建通用DAO. 1.使用 ...
- Oracle connect by 树查询之三(超详细)
查找员工编号为7369的领导: 1 SELECT LEVEL,E.* FROM EMP E CONNECT BY PRIOR E.MGR = E.EMPNO START WITH E.EMPNO = ...
- Spring-JDBC通用Dao
JdbcBaseDao JdbcBaseDao接口,内容如下: package com.sun4j.core.jdbc.dao; import java.io.Serializable; import ...
- 自定义UICollectionViewLayout并添加UIDynamic - scorpiozj(转)
转载自:http://www.tuicool.com/articles/jM77Vf 自定义UICollectionViewLayout并添加UIDynamic UICollectionVie ...
- 自定义注解与MYSQL
无聊之作,可以提意见,但别嘲笑啊 package bean; import java.sql.Date; import annotationK.annotation.Column; import an ...
- cf448D Multiplication Table
D. Multiplication Table time limit per test 1 second memory limit per test 256 megabytes input stand ...
- Codeforces Round #277.5 (Div. 2) A,B,C,D,E,F题解
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud A. SwapSort time limit per test 1 seco ...
- Codeforces Round #256 (Div. 2) 题解
Problem A: A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standar ...
随机推荐
- Trailing Loves (or L'oeufs?)
The number "zero" is called "love" (or "l'oeuf" to be precise, literal ...
- window7下karma 报 The header content contains invalid characters BUG
打开你的依赖node_modules\karma\node_modules\connect\lib\patch.js 将里面的setHeader方法改成下面这样,干掉序列化日期时出现的中文 res.s ...
- DictionaryHelper2
/// <summary> /// DictionaryHelper /// </summary> public static class DictionaryHelper { ...
- 【研究】缓慢的http拒绝服务攻击
1 详细描述: 缓慢的http拒绝服务攻击是一种专门针对于Web的应用层拒绝服务攻击,攻击者操纵网络上的肉鸡,对目标Web服务器进行海量http request攻击,直到服务器带宽被打满,造成了拒绝服 ...
- 使用JDBC连接了数据库的图书管理系统2.0
更新日志: 2019.3.28 数据库版本2.0 1.使用mySQL数据库 2.修改代码使用JDBC连接数据库 3.新增Manage操作类及DBUtils数据库工具类 4.完善代码(封装及方法调用) ...
- ssh设置超时时间
修改server端的etc/ssh/sshd_config ClientAliveInterval 60 #server每隔60秒发送一次请求给client,然后client响应,从而保持连接 Cli ...
- Ace教你一步一步做Android新闻客户端(一)
复制粘贴了那么多博文很不好意思没点自己原创的也说不出去,现在写一篇一步一步教你做安卓新闻客户端,借此机会也是让自己把相关的技术再复习一遍,大神莫笑,专门做给新手看. 手里存了两篇,一个包括软件视图 和 ...
- pat02-线性结构1. Reversing Linked List (25)
02-线性结构1. Reversing Linked List (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, ...
- 记自己的hexo个人博客
https://othercoding.github.io/
- spring 依赖注入总结--为什么官方推荐构造器注入
一 公司小伙伴使用了构造器注入,说是spring的官方推荐.但是,我问了三个问题,他都答不出来,感觉能写篇博文. 官方为什么推荐构造器注入? 构造器注入和属性注入的区别是啥? 你知道有几种注入方式吗? ...