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
Result:
id col1 col2
1 NC_001A>T 5
But I am not sure how to find max value for all similar partically duplicate rows i.e NC_002, NC_003 and so on in the table
Thanking in advance.
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
Code:
select col1, MAX (col2) from table1 where col1 = ('NC_001')group by col1
id col1 col2
1 NC_001A>T 5
But I am not sure how to find max value for all similar partically duplicate rows i.e NC_002, NC_003 and so on in the table
Thanking in advance.
Comment