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
https://forums.phpfreaks.com/topic/268277-mysql-not-showing-duplicate-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.