3
I need to group a query with a detail, the grouping should be done only when the information is repeated in sequence, for example:
id nome
1 lucas
2 lucas
3 marcos
4 lucas
5 marcos
In the example above, only the "Bowls" with ID’s 1 and 2 can be grouped, the other information is not, because they are not in sequence.
Follows excerpt from the query:
$SQL = "select * from clientes where id = '".$id."' group by nome order by id desc ";
$RSS = mysql_query($SQL, $conexao);
while($RS = mysql_fetch_array($RSS)){
echo $RS["nome"]."<br>";
}
You want a php output?
– user60252
That’s right, in PHP
– Lucas Spielmann
You could ask the question the excerpt that seeks this information?
– Don't Panic
See if this helps: How to make a select pick up 8 rows or more where there are common values?
– Bacco
Apparently this solution solved, I need to perform more tests.
– Lucas Spielmann