I was just looking up GROUP BY and see that it's used with an aggregate function, so I think that's not going to work for me.
Allow me to explain more thoroughly what I'm after. I'm trying to validate data from an uploaded CSV file. Errors could include missing values, like first and last names, or an invalid email address. I'm able to do this:
$strQuery = "SELECT
COUNT(CASE WHEN `firstname` = '' THEN 1 END) AS no_first,
COUNT(CASE WHEN `lastname` = '' THEN 1 END) AS no_last,
FROM tablename";
With the results, I can indicate that there are x rows with no first name and y rows with no last name, but it would be more useful for correcting the bad data in the CSV file if the report was something like this:
No first name: rows 3, 11, 20
No last name: rows 1, 8, 11, 39
In other words, I would like to specify what is missing from any given row rather than just note that some rows are missing something.