Linked Questions

Popular Questions

Entity Comparison for Top Values and Lowest Values Query Report

Asked by At

I'm trying to make a comparison to a specific university, for example, Stetson University. I have already got a query that will show me the 10 highest and lowest schools for loan debt at a certain percent degree completion. I just need to compare that specific college in the report with the 10 highest and lowest schools at a certain percent degree completion.

  • 10 highest and lowest schools for loan debt at 10% degree completion
  • 10 highest and lowest schools for loan debt at 25% degree completion
  • 10 highest and lowest schools for loan debt at 75% degree completion
  • 10 highest and lowest schools for loan debt at 90% degree completion

Here is the query I ran previously for the 90 percentile:

SELECT TOP 10 UNITID, INSTNM, CUML_DEBT_P90 FROM MERGED2013_DebtOnly WHERE CUML_DEBT_P90 IS NOT NULL ORDER BY CONVERT(MONEY,STR(CUML_DEBT_P90,8,2)) DESC 

SELECT TOP 10 UNITID, INSTNM, CUML_DEBT_P90 FROM MERGED2013_DebtOnly WHERE CUML_DEBT_P90 IS NOT NULL ORDER BY CONVERT(MONEY,STR(CUML_DEBT_P90,8,2)) ASC

Here are the data types:

CREATE TABLE [dbo].[MERGED2013_DebtOnly](
[UNITID] [float] NULL,
[INSTNM] [nvarchar](255) NULL,
[CUML_DEBT_N] [float] NULL,
[CUML_DEBT_P90] [float] NULL,
[CUML_DEBT_P75] [float] NULL,
[CUML_DEBT_P25] [float] NULL,
[CUML_DEBT_P10] [float] NULL,

Desired Results Image:

Desired Results

Related Questions