Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

T-SQL Challenge

$
0
0

I have a problem in framing a sql query (remember I should use stored procedures and at later point of time I need to convert this to LINQ)

I have a data structure defined like this

Code   Percentage duration_minium_months duration_max_months
A        2%            1                   12
B        2.5%          13                  36
C        3%            37                  999

I have to extract a result like this

Upto 1 Year:  2%
     A
2-3 years : 2.5%
   B
3-4 years : 3%
   C
4-5 years : 3%
   C

5-6 years : 3%

C   
I appreciate your help,
TIA,
Holy


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>