0

When I use:

SELECT DISTINCT first_name, last_name 
FROM books;

Distinct filtered list

It sorts out all the authors by first and last name in my data set but only shows those two columns.

Is there a way to include all other rows of the data table, not just the two listed in the SELECT DISTINCT?

Normally SELECT * FROM books; shows everything. full table

Is there a command to make it so it filters out the authors that are unique by their first and last name but include all other rows as well?

Thanks!

  • 2
    What values would be in the other columns if you have only one row per author? – Bohemian Jul 20 '22 at 03:30
  • there are other columns like books ID, title, release year, and stock, pages. When I use the distinct first and last it only shows two columns. Listing only the first and last name but I would like to see the other data in those rows as well around the new distinct filtered results. – ZWhiteShadow Jul 20 '22 at 03:34
  • You're missing the first question, if an author has two book, what do the book columns look like, which book do you want selected? For a distinct author you only want the author listed once? If this isn't making sense, edit the question with sample data and a sample desired result. – danblack Jul 20 '22 at 03:46
  • Add sample data and expected output. The problem we're highlighting should become obvious. – Bohemian Jul 20 '22 at 04:17

0 Answers0