Well, I think it might be a bit confusing maybe, but I need to do the following: In an example table I'm inserting multiple names in the name column, in which many of these names are the same, I'd like to join all the equal names in one query, and those that are different in another. For example:
nome sobrenome
joão Silva
joão Pereira
joão Santos
Luca João
Luca Jose
In this case, query 1 would result in: João Silva, João Pereira, João Santos and query 2 would be only Luca João and Luca Jose. I'm trying to do this with PHP, a SELECT WHERE joon would solve the problem in that case, however this would have to be done automatically, if it had other names it would do the same thing.