Forum Discussion

anmi's avatar
anmi
Adept
3 years ago

Select Kudos with message query

I am doing a LIQL query for messages 

SELECT id, subject, search_snippet, body, cover_image.view_href,
teaser, view_href, author, conversation.last_post_time, replies.count(*),
metrics.views, kudos FROM messages WHERE category.id = 'DE' AND conversation.style
= 'tkb' AND body MATCHES 'mykeyword' AND depth = 0 ORDER BY post_time
DESC LIMIT 10

 

Can I also retrieve the kudos count with one query. ?

Something like:

SELECT id, subject, search_snippet, body, cover_image.view_href,
teaser, view_href, author, conversation.last_post_time, replies.count(*),
metrics.views, kudos.count(*) FROM messages WHERE category.id = 'DE' AND conversation.style
= 'tkb' AND body MATCHES 'mykeyword' AND depth = 0 ORDER BY post_time
DESC LIMIT 10
  • You want kudos.sum(weight) instead of kudos.count(*)