I've got a matrix column with 110 rows but only 11 values (each value in 11 times). Is there a way to query the distinct values in that column rather than returning all the results?

  • 1
    In a front-end template using the Matrix field's tag? or via an SQL query? Feb 27, 2013 at 0:55
  • Matrix field tag. I can do a manual query, just trying to stay in EE tags if possible.
    – Ryan Shrum
    Feb 27, 2013 at 16:18
  • If you know which rows your values sit in you could use the row_id parameter e.g. {my_matrix_field_name row_id="1|2|3"} Feb 27, 2013 at 23:39

1 Answer 1


You can't do this with a Matrix tag, but you could use Stash to set a list of the Matrix rows, then get the unique values only.


matrix set_list

{exp:channel:entries channel="blog" entry_id="123"}
    {exp:stash:set_list name="blog_related_entries" parse_tags="yes" save="yes" scope="site"}

get_list with unique="yes"

{exp:stash:get_list name="blog_related_entries" unique="yes"}

Granted, this doesn't really save you on performance since all of the Matrix rows are pulled any way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.