Jump to content

Mysql not showing duplicate rows


spec36

Recommended Posts

I am running the following query in my php code.

 

$query="SELECT *, MAX(percent_complete) FROM $dbtable GROUP BY percent_complete DESC LIMIT 4 OFFSET 8";

 

In the database percent_complete has the following rows.

1. 100

2. 80

3. 50

4. 30

5. 30

6. 30

 

The query above lists the percent complete values in a table, but for some reason it is not including the 3x 30 (#4,5,6 above) it only shows the first one. I want to be able to show all 3x30's in the table.

 

Examples:

 

I want it to show like this in the table:

|100|80|50|30|30|30

 

But for some reason it is like this:

|100|80|50|30

 

Anyone have any idea as to why the other two 30% records on not showing in the results?

 

Note: Please don't get confused with the

LIMIT 4 OFFSET 8

in the query and the example I used. The database has enough records after the 8th record to show 4 in the row. This row should technically be showing |30|30|30|30 on my actual test site. But it just shows |30|.

 

Help would be greatly appreciated.

 

Thanks,

 

Spec36

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.