Have a look at the reply I just wrote for Gobi, entitled "Re: Help with an
SQL query". You'll find an explanation there for how to use temporary tables
and joins instead of subqueries in MySQL versions that don't support
subqueries.

Rhino

----- Original Message ----- 
From: "Guy Brom" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Saturday, November 05, 2005 10:28 AM
Subject: LEFT JOIN problem


> I have the following tables:
>
> languages
>  language_id int,
>  language_title varchar(80)
>
> objects
>  object_id int
>  object_language_id int
>  object_title varchar(100)
>
> I want to select ALL available languages, and match the translated object
> (if it is exists) for a specific object_id. If it does not exists for that
> specific language_id, I want to have NULL.
>
> Because I'm using mysql 4.0, no subqueries allowed. Is there any way to
> rewrite the following?
>
> SELECT
>  language_id,
>  language_title,
>  (SELECT object_title FROM objects WHERE object_id = ? AND object_language
=
> l.id) AS object_title
> FROM
>  languages l
>
> Thanks!
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.12.8/161 - Release Date: 03/11/2005
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.8/161 - Release Date: 03/11/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