troubleshooting Question

TOP X from large Table into a View SQL 2008

Avatar of deborahhowson00
deborahhowson00 asked on
Microsoft SQL ServerMicrosoft SQL Server 2008SSRS
3 Comments1 Solution302 ViewsLast Modified:
Hi I have a table with data like follows:

tncy_sys_ref, trans_no, trans_amt
123               1              10
123               2               10
123               3              20
123               4               10
123               5              20
124                1             10
124               2               10
124               3              20
124               4               10
124               5              20

I would like to pull up the most recent transactions (TOP 3 trans_no's) and their corresponding amounts for each tncy_sys_ref.  So the results would show the following:

tncy_sys_ref, trans_no, trans_amt
123               5              20
123               4               10
123               3              20
124               5              20
124               4               10
124               3              20


Many thanks in advance!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros