Record with longest entry

  • Thread starter Thread starter QB
  • Start date Start date
Q

QB

I know this may sound a little paculiar, but I need some help to write a
query that will list the record that has the longest entry (textual length -
Num chars) in a field.

I have a table - tbl_contacts
with 3 fields of interest - first_name, last_name, email

I need to extract the first_name and last_name for the record with the
longest email. How can I do this?

Thank you.
 
Try this --
SELECT TOP 1 first_name, last_name, email
FROM tbl_contacts
GROUP BY first_name, last_name, email
ORDER BY Len() DESC;
 
Back
Top