ixzc commented on issue #24177:
URL: https://github.com/apache/doris/issues/24177#issuecomment-1713254203
When using the ROW_NUMBER() OVER() function, we cannot refer to its alias
directly in the WHERE clause. To achieve your goal, you can use subqueries.
`
SELECT Value, t
FROM (
SELECT Value, ROW_NUMBER() OVER (PARTITION BY TagID ORDER BY TimeStamp
DESC) AS t
FROM dw_target_20230905
WHERE TagID IN (47297, 47298, 47299)
) AS subquery
WHERE t = 1;
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]