Forum Discussion
Off Topic: Need help with SQL Query
- 2 years ago
SELECT
DeviceID,
ModifiedDate,
OBDOdometerMeters,
UTCOBDOdometerMetersDatefrom (
SELECT
DeviceID,
ModifiedDate,
OBDOdometerMeters,
UTCOBDOdometerMetersDate,
ROW_NUMBER() OVER (PARTITION BY DeviceID ORDER BY ModifiedDate DESC , UTCOBDOdometerMetersDate desc ) AS RowNum
FROM
YourTableName
) as aWHERE
RowNum = 1;the previous should work.
however you can try this approach ( using nested selected query ) .
let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
rsbin, give this a whirl:
Thank you kindly for this modification.
Testing it now on the original sql table. Will let you know how I make out.
Best Regards,
- audreygerred2 years agoSuper User
Awesome! Good luck!