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 |
|
Amjath
Yak Posting Veteran
66 Posts |
Posted - 2007-02-12 : 21:08:40
|
| Hi All,I have two different table no relation between them, but i want to join the 2 table how can i do this, plz help me....some thing like this(Table1)SELECT TestId, Station, [Data Required], Criteria FROM RouteCard WHERE StationID = '7' AND AllModel = 1 AND Active = 1OUTER JOIN(Table2)SELECT BIS.Summary_Rate AS Reading, BIS.Summary_Pass AS Result FROM RouteCardEntryDetails AS RED INNER JOIN BurnInStation AS BIS ON RED.MACAddress = BIS.MACAddressThanks And RegardsAmjath |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-12 : 21:18:04
|
you want a CROSS JOIN ?select *from(SELECT TestId, Station, [Data Required], Criteria FROM RouteCard WHERE StationID = '7' AND AllModel = 1 AND Active = 1) across join(SELECT BIS.Summary_Rate AS Reading, BIS.Summary_Pass AS ResultFROM RouteCardEntryDetails AS REDINNER JOIN BurnInStation AS BIS ON RED.MACAddress = BIS.MACAddress) b KH |
 |
|
|
Amjath
Yak Posting Veteran
66 Posts |
Posted - 2007-02-12 : 21:40:49
|
| it gives mXn result.for example 1 table have 2 rows and 2 table have 2 rows the result will contain 4 rows.my need is i want only 2 rows as a resultant for example 1 rows of 1 table join with 1 row of 2 table.in that case when 1 table contain 2 rows and second table contains 1 row then the resultant contain 2 rows only and the value for the 2 row iin 2 table should be nullhow can i get thisplz help meThanks and RegardsAmjath |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-12 : 21:42:52
|
quote: my need is i want only 2 rows as a resultant for example 1 rows of 1 table join with 1 row of 2 table.
Well, you have to specify HOW TO JOIN. Without any information, i can only assume CROSS JOIN  KH |
 |
|
|
Amjath
Yak Posting Veteran
66 Posts |
Posted - 2007-02-12 : 21:52:57
|
| HI Khtan, let me explain in detaili)i have two different table without any relation between them...ii)i want to join this two table(1 to 1 mapping).take casesfor exampletable 1-rows 2 table 2-rows othen resultant contain 2-rows only and the column of table 2 become null.like thiscan we do thisthanks and regardsAmjath |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-13 : 01:02:33
|
| I think you better supplt some sample data and your expected output based on the sample data you provide.Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|
|
|