如何查找最大值以查找部分重复的行 [英] How to find max value to find partially duplicate rows

查看:70
本文介绍了如何查找最大值以查找部分重复的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子1


id col1 col2

1 NC_001A> T 5

2 NC_001C> G 4

3 NC_001G> C 3

4 NC_001_98_G> C 1


现在,我希望对于部分重复的col1值具有max col2值


例如,如果我取col 1值的部分值NC_001A> T,NC_001C> G和NC_OO1G> C,我可以写下面的sql查询

I have a table1

id col1 col2
1 NC_001A>T 5
2 NC_001C>G 4
3 NC_001G>C 3
4 NC_001_98_G>C 1

Now, I want to have max col2 value for partially duplicate col1 value

for example if I take partial value for col 1 values NC_001A>T, NC_001C>G and NC_OO1G>C, I can write following sql query

展开 | 选择 | Wrap | 行号

推荐答案

关闭,你必须定义部分重复因为这可能意味着一百种不同的东西。
First off, you have to define "partially duplicate" since that can mean a hundred different things.


在col1中以类似的模式找到部分重复的值。


例如考​​虑

NC_001A> T,NC_001C> G是一对部分类似的

NC_002A> T,NC_002C_G是另一个两个部分相似的


他们都有不同的表达,例如C> G或G> T
Partially duplicate values are found in similar pattern in col1.

for example consider
NC_001A>T, NC_001C>G are one pair partially similar
NC_002A>T, NC_002C_G are another pair partially similar

they all differ by having expression such as C>G or G>T


ChinTan

我认为你必须首先定义数据的相同之处以及最大的数据。


-z
ChinTan
I think that you''re going to have to start by defining what is the same about the data and what makes it the largest.

-z


这篇关于如何查找最大值以查找部分重复的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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