Click here to Skip to main content
15,907,225 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SAL RANK
........ ............

2000 **
5000 *****
1000 *
900

ANU BODY HELP ME
Posted
Comments
karthik Udhayakumar 19-Apr-14 1:08am    
pls use improve question option and explain what is the requirement..
Bh@gyesh 19-Apr-14 1:11am    
Hi,
What is limit for SAL field. means how many star should come when SAL is going beyond 4 digits (10000, 100000, 500000 etc..)

1 solution

Hello,

VB
SELECT SAL,
CASE
  WHEN SAL >= 1000 THEN '*'
  WHEN SAL >= 2000 and SAL <3000 THEN '**'
  WHEN SAL >= 3000 and SAL <4000 THEN '***'
  WHEN SAL >= 4000 and SAL <5000 THEN '****'
  WHEN SAL >= 5000 and SAL <6000 THEN '*****'
  ELSE ''
END AS [RANK]
FROM [TableName];


Please have a look.

Thanks,
Hitesh Varde
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900