简体   繁体   English

当我有 3 个其他对应列时,如何获得特定对应列的最大值?

[英]How do I get max value for a specific corresponding column when I have 3 other corresponding columns?

I have 4 columns: URL |我有 4 列: URL | keywords |关键词 | Volume (of keyword) |数量(关键字)| Position (of Keyword) Position(关键字)

is there a way I can pull the max(volume) for the URL?有没有办法可以拉出 URL 的最大(音量)? I also want to pull in keyword and position column, but I have multiple values per URL, so when I add the other columns I get back more data than I want.我还想提取关键字和 position 列,但是每个 URL 有多个值,所以当我添加其他列时,我得到的数据比我想要的多。

Not clear on the question,if you mean that you need maximum volume for a given url while retaining the other columns,here is the code: Select url,keywords,position,(select max(volume) from your_table t1 where t1.url=t.url) From your_table t Not clear on the question,if you mean that you need maximum volume for a given url while retaining the other columns,here is the code: Select url,keywords,position,(select max(volume) from your_table t1 where t1.url= t.url) 来自 your_table t

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取最大值和对应的列 - Get Max value and corresponding column Postgres:获取与组中其他列的最大值对应的列的值 - Postgres: Get value of a column corresponding to max of other column in a group 如何选择彼此对应的列值? - How do I select column values to be corresponding to each other? 如何在SQL的另一列中检索与最大值对应的值? - How to retrieve the value which corresponding to the max in an other column in SQL? 在Oracle中,如何找出一/两列数据,其中相应的其他列具有最大值 - In oracle How can I Find out one/two Columns data which corresponding other columns have maximum value 如何获取在 city 列中没有相同值的 ID 列(和其他列)? - How do I get the ID column (& other columns) that do not have the same value in the city column? SQL:最多一列和对应的其他列,已连接表 - SQL: Max of One Column and Corresponding Other Columns, Joined Tables 选择最大值和对应的列 - Selecting Max Value and Corresponding Columns 如何获取下表中每个最小和最大对应的行号 - How do I get the row number corresponding to each min and max in the table below 如何根据另一列的聚合得到一列的对应值? - How can I get the corresponding value of a column based on an aggregate of another column?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM