im not sure if what I am asking for is possible… but it probably is lol.
Basically, I have two tables, tracks and albums.
I want to display a list of all tracks and get the name from the albums part.
The tables look like this:
tbl_tracks
id - int, auto increment, primary key
album_id - int
title - varchar 50
and
tbl_albums
id - int, auto increment, primary key
title - varchar 50
Now, i run the query:
SELECT tbl_tracks.title, tbl_albums.title FROM tbl_tracks, tbl_albums WHERE tbl_tracks.album_id = tbl_albums.id GROUP BY tbl_tracks.title
Now that prints out the following list:
Track1 Artist1
Track2 Artist1
Track3 Artist1
Track1 Artist2
etc..etc..
(The track names arnt as posted i did that for clarity sake)
Now what i want to do is select another column that numbers each track by artist so the above query would output:
1 Track1 Artist1
2 Track2 Artist1
3 Track3 Artist1
1 Track1 Artist2
But i want to do that without any other columns added to the database or without any serverside loops, how would i do this?
1 Answer