----- Original Message ----- 
From: "Chris Kavanagh" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Saturday, March 26, 2005 9:41 PM
Subject: help-a-noob: WHERE statement not working


> Dear list,
>
> Happy Easter if anyone else is working.  This statement is returning a
> syntax error when I insert the WHERE line:
>
> --
> SELECT
> tasks.task_id,
> tasks.name AS taskname,
> tasks.deadline,
> tasks.project_id,
> tasks.importance_id,
> tasks.owner_id,
> tasks.lead_time,
> tasks.status_id,
> projects.project_id,
> projects.name AS projectname,
> people.person_id,
> people.name AS ownername,
> importance.importance_id,
> importance.importance AS importancename
> FROM tasks
> WHERE tasks.status_id=1
> JOIN projects ON tasks.project_id = projects.project_id
> JOIN people ON tasks.owner_id = people.person_id
> JOIN importance ON tasks.importance_id = importance.importance_id
> ORDER BY #order#
> --
>
> It works fine without the WHERE line, which I've tried with and without
> a ; at the end...but no dice.  No doubt I'm doing something stupid: can
> anyone help out?
>
Move the WHERE line so that it is just before the ORDER BY and just *after*
the JOIN lines. There are a variety of Join examples in the MySQL manual
that might be useful in future. For example:
http://dev.mysql.com/doc/mysql/en/join.html

Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.3 - Release Date: 25/03/2005


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

Reply via email to