Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:13:19+00:00 2026-05-28T17:13:19+00:00

Update: Thanks everbody, things are working 100% now with this query: SELECT e.entry_id FROM

  • 0

Update: Thanks everbody, things are working 100% now with this query:

SELECT e.entry_id
FROM exp_channel_titles AS e
INNER JOIN exp_matrix_data AS m ON m.entry_id = e.entry_id
WHERE e.channel_id = 2
GROUP BY e.entry_id
ORDER BY MIN(m.col_id_2) ASC

Here is my code.

Code from .home_laagste_rentes

{exp:channel:entries dynamic="no" fixed_order="0{embed:entry_ids}" disable="member_data|pagination|categories"}
<tr class="{switch="odd|even"}">
    <td><a href="#" title="{title}">{title}</a></td>
    <td>{dk:lowest col="rente" decimals="2" dec_point=","}%</td>
    <td>{count}</td>
</tr>
{/exp:channel:entries}

Code from page:

<table id="rowspan" cellspacing="0" class="tablesorter">
<thead>
    <tr>
        <th>Krediet aanbieder</th>
            <th>Rente</th>
            <th>Beoordeling</th>
    </tr>
</thead>
<tbody>
{embed="embeds/.home_laagste_rentes"
entry_ids="{exp:query sql="
    SELECT DISTINCT (e.entry_id)
    FROM exp_channel_titles AS e
    INNER JOIN exp_matrix_data AS m ON m.entry_id = e.entry_id
    WHERE e.channel_id = 2
    ORDER BY m.col_id_2 ASC
"}|{entry_id}{/exp:query}"}
</tbody>

col_id_2 is set as decimal(10,4)

entry_id is set as int

This is filtering duplicates but it’s not giving the correct order. It looks like filtering duplicates is done random… See this link for output:
http://postimage.org/image/9vzahuuez/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:13:20+00:00Added an answer on May 28, 2026 at 5:13 pm

    You have many, possibly different, m.col_id_2 values, for one e.entry_id.

    Your query is not even valid ANSI SQL, because ORDER BY is evaluated after DISTINCT, so ORDER BY m.col_id_2 should create an error (if your MySQL setting was strict ANSI SQL).

    Solution is to state which value should be used for the ordering, using GROUP BY instead of SELECT DISTINCT:

    SELECT e.entry_id
    FROM exp_channel_titles AS e
    INNER JOIN exp_matrix_data AS m ON m.entry_id = e.entry_id
    WHERE e.channel_id = 2
    GROUP BY e.entry_id
    ORDER BY MAX(m.col_id_2) ASC                  --- or MIN(), or AVG()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
The query: SELECT tbl1.* FROM tbl1 JOIN tbl2 ON (tbl1.t1_pk = tbl2.t2_fk_t1_pk AND tbl2.t2_strt_dt
Update Thanks to Marc's help the AlphaPagedList class is now available on CodePlex if
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really
My code is here $query = SELECT * FROM `table`; $result = mysql_query($query); $arr
UPDATE: Thanks to everyone for the responses. I didn't realize document.write() was deprecated. Add
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here:
Update: Solved, with code I got it working, see my answer below for the
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update : Looks like the query does not throw any timeout. The connection is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.