I assume your table has a indexed time column as SQL Server does not always store records in the order they are created.
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
On a motorcycle
VAPE1
The person was wearing a shirt for an electronic cigarette store.
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
You will need dynamic SQL for this, if I am reading your post correctly. By using johnherman suggestion you can create the code you need
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
Get it, got it, good.
It would help if there were fewer exceptions in English.
I believe this has been discussed before. Not sure though.
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
May not be the best way but...
WITH cte AS (
SELECT Network_id, Status_Code, Status_Time, ROW_COUNT() OVER(PARTITION BY Network_id ORDER BY Status_Time DESC) AS rcnt
)
SELECT Network_id, Status_Code, Status_Time
FROM cte
WHERE rcnt = 1;
djj
The Lord is my shepherd (Psalm 23) - I need someone...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.