You are here: Get ID's from two different tables « PHP SQL « IT news, forums, messages
Get ID's from two different tables

Posted by Nail άnlό on 10/29/05 18:36

Hiho,

I have the following problem. Two tables which have the same primary key
"statusid". I one table i have 10 entries and in the other 7. The 7 from
the second table are also in the first. What i want to do is to get
the other 3.

As the 7 are flagged with a special value, i want to get the other 3,
which dont have this flag.

I know that i can do a UNION to get distinct values from two tables but
i cant do that as the fields are not the same beside the statusid.

To simplfy it:

Table1
-----------------------
statusid | flag |
2123123 | A |
2342342 | B |
3450983 | C |


Table2
-------------------------------
statusid | other fields... |
2123123 | ... |
2342342 | ... |
3450983 | ... |
0980234 | ... |
2342344 | ... |



i hope someone can help me out on this

cu,
Nail

 

Navigation:

[Reply to this 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

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