Skip to content

Performance for Avg & Max in SQL

I want to decrease the query execution time for the following query. This query is taking around 1 min 20 secs for about 2k records. Numbers of records in table: 1348474 Number of records processed through where query: 25000 Number of records returned: 2152 I tried removing the AVG & MAX columns and it lo…

how to pick the column with the highest value

I have a table with different possibilities of marital status (columns), how do I pick up the one with the highest value and keep the column name? For example, below is my original data set: data …