0

I want to select data from ranges like

Column1 Column2
25000 10
50000 20
75000 30

I want records like upto 25000, I get 10
upto 50000, I get 20
upto or more than 75000, I get 30

Can anybody suggest me a simple query for that?

Thanks in advance,

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by jais0n
0

You could use

select Column2
	from table1 t
	where Column1 = ( select min ( Column1	 )
				from table1 ta
				where ta.Column1 > [I]NumberRequired[/I]);

Nige

0

I want to select data from ranges like

Column1 Column2
25000 10
50000 20
75000 30

I want records like upto 25000, I get 10
upto 50000, I get 20
upto or more than 75000, I get 30

Can anybody suggest me a simple query for that?

Thanks in advance,

hello make the question more clear. As per as I understood the ans was
select column1, column2 from table1 order by column2
If u want the ranges give
select column1, column2 from table1 where Column1<= 25000 and Column1 >= 50000

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.