craftsmancoding / query

Query offers a Snippet interface for querying any database collection, e.g. as an alternative to getResources
8 stars 0 forks source link

DISCTINCT filter with this extra? #1

Closed migueldlarosa closed 9 years ago

migueldlarosa commented 9 years ago

Is there way to use the filter DISTINCT of mysql with this extra? Im asking because I wanna create a list of unique tvs of nearly 200 resources in a directory, I hope this can be do it with this extra.

sry, about the typo :P

fireproofsocks commented 9 years ago

DISTINCT is super useful... but its use can often be replaced by more efficient queries. If you need something more complex, you can (should?) use the &_sql parameter to pass in whatever query you want. "Query provides a syntax that aims to support the most common SQL query patterns. It does not attempt to support all valid SQL groupings or operators. If the arguments here get to be too complicated to read, that’s when you should consider writing your own Snippet."

fireproofsocks commented 9 years ago

Take a look at https://github.com/craftsmancoding/query/wiki/Raw-SQL