left join two tables

left join two tables

am 28.04.2011 15:21:20 von Rocio Gomez Escribano

------=_NextPart_000_0004_01CC05B7.EE5A6F80
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0005_01CC05B7.EE5A6F80"


------=_NextPart_001_0005_01CC05B7.EE5A6F80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi!! Is it possible to create a left join consult with 2 tables??

=20

I mean:

=20

SELECT * FROM table1 LEFT JOIN (table2, table3) on table1.ID =3D =
table2.subID
and table1.ID=3D table3.subID

=20

Thanks!!!

=20

Roc=EDo G=F3mez Escribano

=
r.gomez@ingenia-soluciones.com

=20

Descripci=F3n: cid:image002.jpg@01CB8CB6.ADEBA830

Pol=EDgono Campollano C/F, n=BA21T

02007 Albacete (Espa=F1a)

Tlf:967-504-513 Fax: 967-504-513

www.ingenia-soluciones.com

=20


------=_NextPart_001_0005_01CC05B7.EE5A6F80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"> http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"> 12 (filtered medium)"> vlink=3Dpurple>

lang=3DEN-US>Hi!! Is it possible to create a left join consult with 2 =
tables??

lang=3DEN-US> 

lang=3DEN-US>I mean:

lang=3DEN-US> 

lang=3DEN-US>SELECT * FROM table1 LEFT JOIN (table2, table3) on =
table1.ID =3D table2.subID and table1.ID=3D =
table3.subID

lang=3DEN-US> 

lang=3DEN-US>Thanks!!!

lang=3DEN-US> 

lang=3DES-PE style=3D'font-size:10.0pt;color:#0070C0'>Roc=EDo G=F3mez =
Escribano

lang=3DES-PE style=3D'font-size:10.0pt;color:#9D9D9D'> href=3D"mailto:r.sanchez@ingenia-soluciones.com"> style=3D'color:blue'>r.gomez@ingenia-soluciones.com=

style=3D'color:blue'> 

class=3DMsoNormal> border=3D0 width=3D181 height=3D74 id=3D"Imagen_x0020_1" =
src=3D"cid:image001.jpg@01CC05B7.ED54E660" alt=3D"Descripci=F3n: =
cid:image002.jpg@01CB8CB6.ADEBA830">
style=3D'font-size:12.0pt;color:blue'>

class=3DMsoNormal> style=3D'font-size:10.0pt;color:#A6A6A6'>Pol=EDgono Campollano C/F, =
n=BA21T
style=3D'font-size:10.0pt;color:blue'>

class=3DMsoNormal>02007 =
Albacete (Espa=F1a)

lang=3DEN-GB =
style=3D'font-size:10.0pt;color:#9D9D9D'>Tlf:967-504-513  Fax: =
967-504-513

style=3D'font-size:10.0pt;color:#A6A6A6'> href=3D"www.ingenia-soluciones.com" =
title=3D"blocked::www.ingenia-soluciones.com"> style=3D'color:#9D9D9D'>www.ingenia-soluciones.com
lang=3DEN-GB =
style=3D'font-size:10.0pt;color:#A6A6A6'>

class=3DMsoNormal> lang=3DEN-US> 


------=_NextPart_001_0005_01CC05B7.EE5A6F80--

------=_NextPart_000_0004_01CC05B7.EE5A6F80--

Re: left join two tables

am 28.04.2011 15:41:49 von Johan De Meersman

--=_e4b615d0-29c8-489e-ad74-d4700f691db1
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Hey there,

----- Original Message -----

> From: "Rocio Gomez Escribano"

> Hi!! Is it possible to create a left join consult with 2 tables??

> I mean:

> SELECT * FROM table1 LEFT JOIN (table2, table3) on table1.ID =
> table2.subID and table1.ID= table3.subID
Pretty close already. Might I suggest sampling the fine manual ?

Have a look at http://dev.mysql.com/doc/refman/5.0/en/join.html

--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--=_e4b615d0-29c8-489e-ad74-d4700f691db1--

Re: left join two tables

am 28.04.2011 15:54:03 von Darryle steplight

Hi Johan,

I think you probably want something like this. Give the following a shot.

SELECT *
FROM table1
LEFT JOIN table2
ON table1.ID = table2.subID
LEFT JOIN table3
ON table1.ID= table3.subID

On Thu, Apr 28, 2011 at 9:41 AM, Johan De Meersman wrote:
> Hey there,
>
> ----- Original Message -----
>
>> From: "Rocio Gomez Escribano"
>
>> Hi!! Is it possible to create a left join consult with 2 tables??
>
>> I mean:
>
>> SELECT * FROM table1 LEFT JOIN (table2, table3) on table1.ID =
>> table2.subID and table1.ID= table3.subID
> Pretty close already. Might I suggest sampling the fine manual ?
>
> Have a look at http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> --
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
>



--
----------------------------------------------
"May the Source be with you."

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org