Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
xam
Starting Member
1 Post |
Posted - 2002-11-09 : 22:26:04
|
| Hi All,Here is my problem: How can I make an SQL query to do this:Here is the result I'd like to get NAME ZONE INDEX---------------------------------------------ALCATEL EUROPE 2 MICROSOFT AMERICA 1LOREAL EUROPE 1 I have 4 tablestable 1: ENTITY-----------------------entityid (PK) name----------------------10 ALCATEL20 MICROSOFT30 LOREALtable 2: TYPE----------------------------typeid(PK) name----------------------------10 ZONE20 INDEXtable 3: ENTC---------------------------------------entcatid(PK) typeid (FK) name-----------------------------------10 10 EUROPE20 10 AMERICA30 20 140 20 2table 4: ENTCC(typeid,entcatid) is the PK---------------------------------------entityid(FK) typeid (FK) entcatid(FK)-----------------------------------10 10 1010 20 4020 10 2020 20 3030 10 1030 20 30Thanks in advance,xaxa |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-11-10 : 02:24:56
|
| Hi thereYou need to "JOIN" those tables together.Look in Books Online (The SQL Server documentation) for the term "INNER JOIN", and read up on that. There will ba some sample queries to help you understand this.Post back here if you have any questions.Good luckDamian |
 |
|
|
|
|
|