Reply to Re: Get ID's from two different tables

Your name:

Reply:


Posted by Nail άnlό on 10/30/05 12:49

ZeldorBlat schrieb:
> It sounds like you want to outer join the tables to that you get all
> the rows, even if they don't have a flag. So if, according to your
> example, Table2 is the one with 10 rows and Table1 is the one with 7
> rows, you could do this:
>
> select t2.*, t1.flag
> from table2 t2
> left outer join table1 t1
> on t2.statusid = t1.statusid
>

i forgot to mention that table2 has much more records but only 10 that
would much table1 id...

actually the primary key on both tables is a composed key from 2 fields
id ans shipref....and in table1 i have only 7 records and on
table2...over 6Mio...

It should only get the records from t2 which have
t2.statusid=t1.statusid AND t2.shipref=t1.shipref ...but this doesnt
seem to work with the left outer join...


cu,
Nail

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация