Hey, I have a database that has information about bands. Basically it has the artist name and song name etc... If I have a database with the following content: artistName............songName Muse................Plug in Baby Muse................Starlight Muse................Newborn Muse................Bliss Strokes.............Is This It Strokes.............Heart in a Cage Strokes.............Last Night What SQL do I need to use to I select the artistNames so that each unique value only shows up once? So for the example above I want to get "Muse" and "Strokes", instead of "Muse", "Muse", "Muse", "Muse", "Strokes", "Strokes", "Strokes", which is given by the SQL "SELECT artistName FROM artistInfo"? Thanks, Hodge
SELECT DISTINCT artistName FROM artistInfo or SELECT artistName FROM artistInfo GROUP BY artistName; You can get the number of songs each artist has for free in this way: SELECT artistName,COUNT(*) FROM artistInfo GROUP BY artistName;