SQL 中的模糊一一匹配
来源:互联网 发布:大数据咨询公司 编辑:程序博客网 时间:2024/05/17 02:29
Table test1:
ID NAME VOLUMN
----------------------------------------------------------------------- ---------------------------
1 A1 1000
2 A2 1000
3 A3 1000
Table test2
ID NAME VOLUMN
----------------------------------------------------------------------- ---------------------------
1 B1 1000
2 B2 1000
3 B3 1000
if we just inner join them by same Volumn, will got 9 records,
select test1.id id1, test2.id id2
from test1, test2 where test1.volumn= test2.volumn;
ID1 ID2
--------------------------------------- ---------------------------------------
3 1
2 1
1 1
3 2
2 2
1 2
3 3
2 3
1 3
But use below sql, we can get oneone match ids:
select * from (
select test1.id id1,test2.id id2, row_number() over(partition by test1.id order by test2.id)order1, row_number() over(partition by test2.id order by test1.id) order2
from test1, test2 wheretest1.volumn= test2.volumn
) where order1 =order2;
ID1 ID2 ORDER1 ORDER2
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
1 1 1 1
2 2 2 2
3 3 3 3
- SQL 中的模糊一一匹配
- SQL模糊匹配查询
- SQL 之 模糊匹配
- jquery中的模糊匹配
- SQL 模糊查询 模糊查找 字符串匹配
- 正则表达式中的模糊匹配
- SQL中的模糊查询
- SQL中的模糊查询
- sql中的模糊查询
- 通用算法-sql相似度模糊匹配
- SQL 多字段模糊匹配关键字查询
- sql模糊匹配中%、_的处理
- SQL模糊匹配后再分组
- oracle中的截取,模糊匹配小结
- jquery中的模糊匹配查找标签
- python 在MySQL中的模糊匹配
- thinkphp中的多字段模糊匹配
- 模糊匹配数据库中的json字段
- 删除还原我的电脑 回收站
- 乘积的末3位
- Java枚举
- 二叉搜索树与双向链表
- 怎样编写高质量的Java代码
- SQL 中的模糊一一匹配
- LeetCode Pascal's Triangle II
- 黑马程序员-工具类Collections&Arrays
- 道路识别
- 用JS封装AJAX请求 XMLHttpRequest (面试前记得复习)
- Struts2配置文件入门
- 稀疏表示(Sparse Representation)_Elad' slide
- STM 32的PWM的频率和占空比设定
- DDR2 SSTL_18标准