http://www.mysql.com/doc/J/O/JOIN.html says that "INNER JOIN and , (comma)
are semantically equivalent. Both do a full join between the tables used.
Normally, you specify how the tables should be linked in the WHERE
condition."

So you could use this instead:

SELECT FORUMCAT1.LASTPOST, USERS.USERNAME, FORUMCAT1.ID, FORUMCAT1.TOPIC,
FORUMCAT1.REPLIES, FORUMCAT1.ORIGINATOR, FORUMCAT1.STATUS FROM
USERS,FORUMCAT1,FORUMMSG1 WHERE (USERS.ID = FORUMMSG1.AUTHORID AND
FORUMCAT1.ID = FORUMMSG1.POSTNUMBER AND (FORUMCAT1.STATUS !=2) AND
(FORUMMSG1.MESSAGE Like "%java%"))
ORDER BY FORUMCAT1.LASTPOST DESC;

Duncan
--
Duncan Salada | Titan | www.titan.com/validity
Email: [EMAIL PROTECTED] | Voice: 301-925-3222x375 | Fax: 301-925-3216

> -----Original Message-----
> From: Mat Murdock [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 22, 2002 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: Re: How to rewrite this statement.
> 
> 
> Ok, so I updated the statement like the past few posts have 
> directed so the
> statement looks like this:
> 
> SELECT FORUMCAT1.LASTPOST, USERS.USERNAME, FORUMCAT1.ID, 
> FORUMCAT1.TOPIC,
> FORUMCAT1.REPLIES, FORUMCAT1.ORIGINATOR, FORUMCAT1.STATUS
> FROM USERS INNER JOIN (FORUMCAT1 INNER JOIN FORUMMSG1 ON 
> FORUMCAT1.ID =
> FORUMMSG1.POSTNUMBER) ON USERS.ID = FORUMMSG1.AUTHORID
> WHERE ((FORUMCAT1.STATUS !=2) AND (FORUMMSG1.MESSAGE Like "%java%"))
> ORDER BY FORUMCAT1.LASTPOST DESC;
> 
> And this is the message that I get:
> 
> You have an error in your SQL sytax near '(FORUMCAT1 INNER 
> JOIN FORUMMSG1 ON
> FORUMCAT1.ID = FORUMMSG1.POSTNUMBER)ON USERS' at line 1.
> 
> Thanks,
> 
> Mat
> 
> 
> 
> ----- Original Message -----
> From: "Nathan" <[EMAIL PROTECTED]>
> To: "Mat Murdock" <[EMAIL PROTECTED]>
> Sent: Friday, February 22, 2002 12:03 PM
> Subject: Re: How to rewrite this statement.
> 
> 
> > Where does mysql say there is a problem? By the by, your 
> WHERE clause
> should read thusly:
> >
> > WHERE FORUMCAT1.STATUS != 2 AND FORUMMSG1.MESSAGE LIKE "%java%"
> >
> > MySQL does not use <> for not equal to AFAIK, and you don't need to
> enclose the clauses in parens.
> > Also, the wildcards for LIKE are % for * and _ for ? if you 
> get my meaning
> ;-)
> >
> > Let us know what the error is.
> >
> > # Nathan
> >
> > ----- Original Message -----
> > From: "Mat Murdock" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, February 22, 2002 11:51 AM
> > Subject: How to rewrite this statement.
> >
> >
> > I have this query that works just fine in msacess agains 
> some linked mysql
> > tables, but if I run this statement in php or in mysqlfront 
> it doesn't
> work.
> > I belive it's because there is two joins in it but i'm not 
> sure.  If that
> is
> > the problem then what is the work around?  Here is the statement:
> >
> > SELECT FORUMCAT1.LASTPOST, USERS.USERNAME, FORUMCAT1.ID, 
> FORUMCAT1.TOPIC,
> > FORUMCAT1.REPLIES, FORUMCAT1.ORIGINATOR, FORUMCAT1.STATUS
> > FROM USERS INNER JOIN (FORUMCAT1 INNER JOIN FORUMMSG1 ON 
> FORUMCAT1.ID =
> > FORUMMSG1.POSTNUMBER) ON USERS.ID = FORUMMSG1.AUTHORID
> > WHERE (((FORUMCAT1.STATUS)<>2) AND ((FORUMMSG1.MESSAGE) 
> Like "*java*"))
> > ORDER BY FORUMCAT1.LASTPOST DESC;
> >
> > Thanks ahead of time!
> >
> > Mat
> >
> >
> > 
> ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: 
http://lists.mysql.com/php/unsubscribe.php
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to