LMSouq
database Open

MySQL select one column DISTINCT, with corresponding other columns

M
m r
1 month ago
3 views
Problem Description
ID FirstName LastName 1 John Doe 2 Bugs Bunny 3 John Johnson I want to select `DISTINCT` results from the `FirstName` column, but I need the corresponding `ID` and `LastName`. The result set needs to show only one `John`, but with an `ID` of 1 and a `LastName` of Doe.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base