2 Replies

  • The first, with DISTINCT first, will return a single value of the count of all business ID's.  The way it's written, the DISTINCT actually doesn't do anything, since only one distinct value would have ever been returned anyway.

    The second, a count of DISTINCT business ID's, would return a different value from the first if there were any duplicates in Business ID's column.  It would only count the distinct ones, and not count any duplicates, whereas the first query would count every row even duplicates.

    Spice (3) flagReport
    4 found this helpful thumb_up thumb_down
  • https://www.w3schools.com/sql/sql_distinct.asp

    Was this post helpful? thumb_up thumb_down

Read these next...