0 Replies Latest reply: Feb 23, 2012 7:29 PM by Corey Mathews RSS

    Figuring out who wrote content that was liked

    Corey Mathews

      I was playing around with the SQL queries tonight trying to figure out who wrote some content that was liked, but my numbers just aren't matching up. Has anyone run a similar query? Can anyone verify that at least I'm thinking about this the right way?

       

      1. I find the content that was liked in the jivedw_acclaim table.
      2. The object_id in jivedw_acclaim corresponds with the content_id value in jivedw_content.
      3. The jivedw_content table gives me a user_id for each piece of content, and I can then grab the user_id from jivedw_user.

       

      Therefore, if I pull the data below, I should be able to get it to line up, right? I could filter by acclaim_type and creation_ts to limit it to just likes in a particular month.

      SELECT

        jivedw_acclaim.object_id,

        jivedw_acclaim.acclaim_type,

        jivedw_acclaim.creation_ts,

        jivedw_content.content_id,

        jivedw_content.user_id,

        jivedw_user.user_id,

        jivedw_user.username

      FROM

        public.jivedw_acclaim,

        public.jivedw_content,

        public.jivedw_user

      WHERE

        jivedw_acclaim.object_id = jivedw_content.content_id AND

        jivedw_content.user_id = jivedw_user.user_id;

       

      Any guidance would be much appreciated.