I would like to add a condition from image properties’ ID in this attached query.
By the way, I would like to make this part dynamic. So I don’t want to just input a hard code “mypage_thumbnail” here. I would like to know how to get image properties’ ID dynamically.
Without dynamic img tag id setting, I am trying to do this sql query though, it doesn’t work.
(I tried to do custom query too)
Anyone has any idea?
This query worked when I did on sql server directly.
But I don’t know how to set in the query of server connect app.
SELECT * FROM filepath where iduser={{security1.identity}} ANDui_position=‘mypage_cover’ andtimestamp=(selectmax(timestamp) from filepathwhere (iduser={{security1.identity}} ANDui_position=‘mypage_cover’))
I don’t know how to set after timestamp = especially.
This needs to be done via a custom query and should be possible, Your initial query is almost correct, try this
SELECT * FROM filepath
WHERE iduser={{security1.identity}} AND ui_position=‘mypage_cover’
AND timestamp IN (select max(timestamp)
FROM filepath
WHERE (iduser = {{security1.identity}} AND ui_position = ‘mypage_cover’))