If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Troubles with the Versions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-03, 14:44
fduo fduo is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Red face Troubles with the Versions

Hello,

I have big Problem. I build a Database driven WebSite but tested and developed my Code with MySQL 4.0.x. But on my Server i have MySQL 3.23.49 because it is last stable release for Debian. My support told me that, i hope that it is true.
And i think some SQL features from 4.0.x are not included in the 3.23.49version. I think Subquerys and Joins (just a guess, please correct me) aren't support. But i have no idee how to write the SQL query without that.
Could somebody help me?
I post the Query in SQL, the Error Message and the tables.

SQL Statement:

SELECT Ausstellung.titel,Ausstellung.gbeschreib,Kuenstler .bezeichnung,concat(date_format(start,'%d.%m'),' - ',date_format(ende,'%d.%m.%y')) as datum, Ausstellung.start, Kuenstler.KID, Kuenstler.Name Name, Kuenstler.Vorname Vorname, erarbeitet.AID AID FROM Kuenstler RIGHT JOIN (Ausstellung LEFT JOIN erarbeitet ON Ausstellung.AID = erarbeitet.AID) ON Kuenstler.KID = erarbeitet.KID WHERE (date_format(Ausstellung.start,'%y')= '01') order by Ausstellung.AID

ERROR:

You have an error in your SQL syntax near '(Ausstellung LEFT JOIN erarbeitet ON Ausstellung.AID = erarbeitet.AID) ON Kuenst' at line 1

Tables:

CREATE TABLE `kuenstler` (
`KID` bigint(20) NOT NULL auto_increment,
`Name` varchar(255) default NULL,
`Vorname` varchar(255) default NULL,
`bezeichnung` text NOT NULL,
PRIMARY KEY (`KID`,`KID`)
) TYPE=MyISAM AUTO_INCREMENT=28 ;
_______

CREATE TABLE `ausstellung` (
`AID` int(11) NOT NULL auto_increment,
`Start` date default NULL,
`Ende` date default NULL,
`gBeschreib` varchar(255) default NULL,
`Titel` varchar(255) default NULL,
`Bild1` varchar(255) default NULL,
`Bild2` varchar(255) default NULL,
`Bild3` varchar(255) default NULL,
`Bild4` varchar(255) default NULL,
PRIMARY KEY (`AID`)
) TYPE=MyISAM AUTO_INCREMENT=21 ;

_______

CREATE TABLE `kuenstler` (
`KID` bigint(20) NOT NULL auto_increment,
`Name` varchar(255) default NULL,
`Vorname` varchar(255) default NULL,
`bezeichnung` text NOT NULL,
PRIMARY KEY (`KID`,`KID`)
) TYPE=MyISAM AUTO_INCREMENT=28 ;

Please if u think that it isn't possible to do the same Statement in MySQL 3.23.49, teel me this.


Thank u that u read it and if u have any comments or solutions, please tell me these.

Regards
Fabio
Reply With Quote
  #2 (permalink)  
Old 12-22-03, 14:55
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
instead of this --
Code:
  FROM Kuenstler 
RIGHT
  JOIN (
       Ausstellung
LEFT
  JOIN erarbeitet 
    ON Ausstellung.AID = erarbeitet.AID
       ) 
    ON Kuenstler.KID = erarbeitet.KID
try this --
Code:
  FROM Ausstellung
LEFT
  JOIN erarbeitet 
    ON Ausstellung.AID = erarbeitet.AID
LEFT
  JOIN Kuenstler
    ON erarbeitet.KID  = Kuenstler.KID
also, if you really want to ORDER BY Ausstellung.AID then you should probably include it in the SELECT list

rudy
http://r937.com/

(der lederhosen guy)
Reply With Quote
  #3 (permalink)  
Old 12-22-03, 15:36
fduo fduo is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Great, it works!!

Thanks r937,

Thanks for fast reply.
Thanks for solution.

Have a great day and merry christmas.

Regards
Fabio
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On