Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Retriev Top to columns of table based on latest date

$
0
0

Hi all,

I have the below table

Date                 Value

1/1/2012            1000

1/1/2013            2000 

1/1/2014            3000

I need a querry which will fetch the latest two dates and values. ie it should retrieve as below

Date                 Value

1/1/2013            2000 

1/1/2014            3000

Thanks in advance.


Viewing all articles
Browse latest Browse all 8428

Trending Articles



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