Jump to content

Product listing make query with "SELECT DISTINCT"


cisap
 Share

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)

Share this post


Link to post
Share on other sites

  • 3 years later...

Hello,

I'm facing the same problem... have you found the solution?

I tried :

$this->_select = 'distinct(a.id_carrier),b.*'

But it doesn't work...

Thanks in advance,

Ronan

Share this post


Link to post
Share on other sites

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More