• Resolved adamglatt

    (@adamglatt)


    Firstly, thank you for developing this plugin. It’s fantastic.

    I’d like to query the data but am having issues aggregating. Can someone assist with the sample query below?

    SELECT
    IF(ev.slug='user_id', ev.value, NULL) as user_id
    IF(ev.slug='date', ev.value, NULL) as date
    FROM table_name ev

    This gives me the values I want, but also all the NULLS inbetween. How can I aggregate or group the results?

    I tried a simple GROUP BY user_id, but get an error. Any help is greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter adamglatt

    (@adamglatt)

    Just updating to add that I would ideally like to group it by user_id.

    Thread Starter adamglatt

    (@adamglatt)

    User Error: I was trying to use the wrong table. (values instead of submits)

    For anyone else wondering, I re-read this page and was able to successfully query the data I wanted.

    Thanks again for a great plugin!

    • This reply was modified 9 years, 6 months ago by adamglatt.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How does one query the database?’ is closed to new replies.