Hallo!
Ich habe ein kleines Problem mit einem INNER JOIN Query. Kann mir jemand sagen, wo mein Fehler liegt? Wäre euch für eure Hilfe sehr dankbar.
MfG, Andy
DATENBANK
INNER JOIN
Ich habe ein kleines Problem mit einem INNER JOIN Query. Kann mir jemand sagen, wo mein Fehler liegt? Wäre euch für eure Hilfe sehr dankbar.
MfG, Andy
DATENBANK
Code:
CREATE TABLE `categories` ( `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT, `category` VARCHAR( 30 ) NOT NULL , PRIMARY KEY ( `id` ) , UNIQUE (`category`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `courses` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(50) NOT NULL default '', `date` int(11) NOT NULL default '0', `offerer` varchar(30) NOT NULL default '', `place` varchar(30) NOT NULL default '', `country` varchar(2) NOT NULL default '', `commissary_id` int(10) NOT NULL default '0', `category_id` int(10) NOT NULL default '0', PRIMARY KEY (`id`), KEY `commissary_id` (`commissary_id`), KEY `category_id` (`category_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Code:
SELECT
title, category, offerer, place, country
FROM
courses
INNER JOIN
categories
ON
courses.category_id = categories.id
WHERE
courses.offerer = `Avexis` AND courses.place = `Dortmund`
ORDER BY
courses.title DESC
LIMIT 2

Kommentar