From below tables I would to like to write TSQL query to get the below results, please help on it.
IF OBJECT_ID('tempdb..#NetWorthAnticipated') IS NOT NULL
DROP TABLE #NetWorthAnticipated;
) AS a (MinRange, MaxRange);
IF OBJECT_ID('tempdb..#Networth') IS NOT NULL
DROP TABLE #Networth;
( '$25,000 and under' ),
( '$1,000,001 - $3,000,000' ),
( '$200,001 - $500,000' ),
( '$25000 - $50000' ),
( '$500,001 - $1,000,000' ),
( '$50,001 - $200,000' ),
( '$50,001-200,000' )
) AS b (NetWorth);
SELECT FROM #Networth
SELECT FROM #NetWorthAnticipated
From the above tables need the below Results :
Thank you for the reply, That's what the task actually, I tried by using cast function which includes Rank function but still not able to find the above results.
Could you please suggest anyway to do it by TSQL ?
And please avoid double posts.