# How to find to the people have liked me?

**URL:** <https://meta.discourse.org/t/how-to-find-to-the-people-have-liked-me/61092>\
**Category:** Development\
**Created:** [4월 17, 2017, 4:12오전 UTC](https://meta.discourse.org/t/how-to-find-to-the-people-have-liked-me/61092 "2017-04-17T04:12:11Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [4월 18, 2017, 6:05오후 UTC](https://meta.discourse.org/t/how-to-find-to-the-people-have-liked-me/61092/11 "2017-04-18T18:05:00Z")

</div>

This query might be close to what you want, tweak to suit eg. add a WHERE user\_id = an id for a single user

```plaintext
SELECT 
 user_actions.user_id 
 , array_agg(DISTINCT user_actions.acting_user_id) 
FROM user_actions 
WHERE 
 user_actions.action_type = 2 
GROUP BY user_actions.user_id

```

“2” is “liked” and “acting\_user\_id” is the “giver”

You may prefer to use AR pluck, but it would be the same table

---

_[View the full topic](https://meta.discourse.org/t/how-to-find-to-the-people-have-liked-me/61092)._
