Hi,

I have a problem with selecting / ordering by different criteria from
different tables. Maybe this doesn't even work, or there is a much
better way?

I have the following tables which look like this:

table tartist
+----+------+------+-------+-------+
| id | name | info | image | genre |
+----+------+------+-------+-------+

table programm
+----+------+-------+--------+
| id | date | stage | artist |
+----+------+-------+--------+

I want to be able to sort by stage and genre. Stage is no problem, since
it's kept in the programm table. Sorting by genre I believe could work
with a JOIN, but I have tried and didn't quite understand what and where
to join things here.

The idea is:
SELECT id, date, stage, artist FROM programm WHERE tartist.id=artist AND
tartist.genre=$genre;

In words:
Select every row from programm where artist matches the id in tartist
and where genre in tartist is of value $genre.

Any help is appreciated, thanks in advance,
Holger

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to