I just changed from Access to mySQL. I have a few tables, called "Veranstaltung" and "Veranstaltung_User". I want to get all events (=Veranstaltung) to which users have subsribed, exept the one, the user is viewing.
I did this with the following statment
SELECT VID, Bezeichnung, Datum
FROM tbl_Veranstaltung
WHERE year(Datum) = 2012
AND VID <> 613
AND VID IN (SELECT BewerbID
FROM Veranstaltung_User
WHERE UserID IN (SELECT UserID
FROM Veranstaltung_User
WHERE BewerbID = 613)
AND UserID <> 0)
ORDER BY Datum
In Access, this query was quite fast - in mySQL it needs 44,56 seconds - too much ;-)
how can I optimize my statement for faster quering? (mySQL > 5, tables ware MyISAM)
thanks for help