I am having trouble getting an inner join to work; up front I must say that I haven't quite figured joins of any flavour out yet.
My SELECT statement looks like this:
SELECT artwork.artist_id, artwork_id, title, artwork_photo_filename, artist_lname FROM artwork INNER JOIN ref_artists ON ref_artists.artist_id = artist_id WHERE TRUE ORDER BY artist_lname
the two tables I am trying to join are:
artwork - which contains artist_id, artwork_id, title, and artwork_photo_filename (and a bunch of other fields)
ref_artists - which contains artist_id and artist_lname (and artist_fname)
In the select statement the 'WHERE TRUE' statement comes from Kevin Yank's book and is holding the place of a WHERE clause which sometimes has other parts (including possible AND artist_id = x).
The reason I need this SELECT statement is because an artist may be added at any time and so naturally after a while the artist_id field is not in alphabetical order; and I am getting all my info from the artwork table in which there is only artist_id.
Many thanks in advance, and I can supply more info if needed.