January 26, 2008 at 10:13 pm
Please Help Me!
I have a relational database.
I have a field that relate to another field from onother Table.
I must Select all Fields (join tables and get my data)
How get Relational Tables between tow table and create join statement in my query?
January 27, 2008 at 9:38 am
select *
from Table1
inner join Table2
on Table1.Column1 = Table2.Column2
Put your table names and column names into this.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
January 27, 2008 at 10:00 pm
Hi,
Instead of * Use ColumnName whatever you want.
SELECT t1.ColumnName1,t1.ColumnName2,t2.ColumnName1,t2.ColumnName2,...
FROM Table1 AS t1
INNER JOIN Table2 AS t2
ON t1.ColumnName = t2.ColumnName
---
January 28, 2008 at 1:10 am
Is this homework? 😀
I recommend you look up some sort of SQL Tutorial in Google, or get a "Teach yourself SQL in 24 hours/30 days" style of book. You'd do well to understand what's possible and how things work to use the relational database efficiently.
January 28, 2008 at 4:53 am
And look up "JOIN" in Books Online. That should help you figure it out.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply