I have Process
SQL Server table and some columns and their values.
ID Step StateID SenderNo
61cc2608-81b8-48a2-89ce-8887438985bb 9 125 1750069133
61cc2608-81b8-48a2-89ce-8887438985bb 8 120 1111111162
61cc2608-81b8-48a2-89ce-8887438985bb 5 116 1111111162
61cc2608-81b8-48a2-89ce-8887438985bb 2 115 3900383669
61cc2608-81b8-48a2-89ce-8887438985bb 1 113 1750069133
14dsfgd4-123d-21ds-86ds-124sgslkgj31 9 125 1750069133
14dsfgd4-123d-21ds-86ds-124sgslkgj31 8 120 1111111162
14dsfgd4-123d-21ds-86ds-124sgslkgj31 5 116 1111111162
14dsfgd4-123d-21ds-86ds-124sgslkgj31 2 115 3900383669
14dsfgd4-123d-21ds-86ds-124sgslkgj31 1 113 1750069133
21456qwf-674s-75df-53sg-125sdfsgsd47 5 116 1111111162
21456qwf-674s-75df-53sg-125sdfsgsd47 2 115 3900383669
21456qwf-674s-75df-53sg-125sdfsgsd47 1 113 1750069133
I want to get data according to highest Step
value. Like that;
ID Step StateID SenderNo
61cc2608-81b8-48a2-89ce-8887438985bb 9 125 1750069133
14dsfgd4-123d-21ds-86ds-124sgslkgj31 9 125 1750069133
21456qwf-674s-75df-53sg-125sdfsgsd47 5 116 1111111162
I have no idea how to write the necessary T-SQL query in ASP.Net (C#)...
Step
? I see rows with8
... can you clarify? Or do you mean the highest step per ID? – Marc Gravell♦ Nov 19 '13 at 13:36Dapper
, but this is a start. – Michael Perrenoud Nov 19 '13 at 13:37