Author |
Topic |
pamit_1982
Starting Member
13 Posts |
Posted - 2007-05-03 : 09:40:30
|
Hi this problem may be real dumb but for a dumber like me..I have 3 tables TBla,tblb,tblctbla and tbl b have a common column xwhilr tblb and tblc have yhow to join these table as to get value accordingly. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-05-03 : 09:42:56
|
select a.*, b.*, c.*from tbla as ainner join tblb as b on b.x = a.xinner join tblc as c on c.y = b.yPeter LarssonHelsingborg, Sweden |
 |
|
pamit_1982
Starting Member
13 Posts |
Posted - 2007-05-03 : 09:49:11
|
Thanks Peter,I tried all that but the damn data is not coming .I tried all the joins.guys .. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-05-03 : 09:54:00
|
I have no idea what you mean by "accordingly".Please post some sample data and your expected output.Peter LarssonHelsingborg, Sweden |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-03 : 09:55:49
|
are ouy sure that the correct data is in the tables at all?_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
pamit_1982
Starting Member
13 Posts |
Posted - 2007-05-03 : 10:03:08
|
Sorry guys ..There are duplicate data in the tables..May be that is cousing problem |
 |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2007-05-03 : 11:15:57
|
Duplicate records would not prevent the damn data from coming. Duplicate records would bring back too much damn data.You need to make sure that for every damn record in table A there are matching records in table B, and for every damn record in table B there are matching records in table C. Otherwise, the damn inner joins will prevent any records from being returned.e4 d5 xd5 Nf6 |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-03 : 11:31:04
|
and DAMN to that bad mood today bruce?_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2007-05-03 : 13:25:25
|
quote: Originally posted by pamit_1982 Thanks Peter,I tried all that but the damn data is not coming .
I was just trying to help out the damn poster with his damn problem.e4 d5 xd5 Nf6 |
 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2007-05-03 : 14:52:43
|
quote: Originally posted by blindman Duplicate records would not prevent the damn data from coming. Duplicate records would bring back too much damn data.
    haven't laughed that hard after reading a post in a while...  www.elsasoft.org |
 |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2007-05-03 : 16:15:45
|
Its all in thee4 d5 xd5 Nf6 |
 |
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2007-05-03 : 16:16:01
|
...timing.e4 d5 xd5 Nf6 |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-05-03 : 17:17:41
|
Made I chuckle too ...Next time one of the DEVs complains some SQL statement is not giving them the data they want I can just say "It'll be those damn inner joins" !!Mind you, they'll probably just use Cartesian joins then, and a "little loop in VB to sort the data out" Kristen |
 |
|
|