MySQL Forums
Forum List  »  General

How do i sort data in a database
Posted by: Robert James Love
Date: March 31, 2005 09:04AM

In my table 'music', i have three columns: Artist, Album and Track.

For my example i will show you some rows in my table:

Artist Album Track
==== ===== =====
The Killers Hot Fuss 01 - Jenny was a Friend of Mine
The Killers Hot Fuss 02 - Mr. Brightside
The Killers Hot Fuss 03 - Smile Like You Mean It
The Killers Hot Fuss 04 - Somebody Told Me
The Killers Hot Fuss 05 - All These Thinks that I've Done
Snow Patrol Final Straw 01 - How To Be Dead
Snow Patrol Final Straw 02 - Wow
Snow Patrol Final Straw 03 - Gleaming Auction
Bryan Adams Room Service 01 - East Side Story
Bryan Adams Room Service 02 - This Side Of Paradise
Bryan Adams Room Service 03 - Not Romeo Not Juliet
Bryan Adams Room Service 04 - Shes A Little Too Good For Me


The sql query i use is "SELECT Artist, Album" from music"

However this displays the following:

The Killers Hot Fuss
The Killers Hot Fuss
The Killers Hot Fuss
The Killers Hot Fuss
The Killers Hot Fuss
Snow Patrol Final Straw
Snow Patrol Final Straw
Snow Patrol Final Straw
Bryan Adams Room Service
Bryan Adams Room Service
Bryan Adams Room Service
Bryan Adams Room Service


All i want is the table to display the following:

The Killers Hot Fuss
Snow Patrol Final Straw
Bryan Adams Room Service


Does anybody know the sql query i should use to get this information. Your help would be greatly appreciated. Thanks.

Options: ReplyQuote


Subject
Written By
Posted
How do i sort data in a database
March 31, 2005 09:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.