Image properties' ID for the query condition


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.

Please let me know how to do it.


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}} AND ui_position=‘mypage_cover’ and timestamp=(select max(timestamp) from filepathwhere (iduser={{security1.identity}} AND ui_position=‘mypage_cover’))

I don’t know how to set after timestamp = especially.

With the query builder you can’t use nested queries, so that will not work. Use the custom query instead.

What is the problem that you have when using the custom query?

Now I am trying to reproduce it though, I got another error.
I attach log file here too. (317.4 KB)

I could solve this somehow! thanks!!


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’))
1 Like

Thank you so much. I could use custom query anyway and could get what I wanted!