Hi
if myTable has a column like

Col
10
7 
3
5
9
4

How can I select three smallest numbers?
my resultset should be

3
4
5
I don't prefer the following;

with myT as 
(select col from myTable order by col)
select top(3) from myT

Any better idea?
thanks

Recommended Answers

All 2 Replies

I'd go with

SELECT TOP 3 FROM myTable ORDER BY myCol ASC

Oh
Thanks. Don't know how I missed that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.