Jump to content

Product listing make query with "SELECT DISTINCT"


cisap

Recommended Posts

Hi Folks,

 

Currently I'm developing a specific module for a site, which makes some associations to _products table.

 

Via override i'd like to extend the list with one column (related above)

 

The problem is, that there're suddenly duplicate row(s) in the list. When i copy out the query, and extend SELECT with DISTINCT all things goes well natively.

 

The real question: is there a "standard" way to make select "distinty" (tried $this->_select, but there writes it at the middle of the fieldlist)

 

 

One more thing: tried the
$this->_group = ' GROUP BY a.`id_product`'
which gave the correct list, but this way the summary number is incorrect (up-left-corner)

 

--

Thanks,

Olivér

Edited by cisap (see edit history)
Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...