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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query help

Author  Topic 

sqldba2k6
Posting Yak Master

176 Posts

Posted - 2007-05-11 : 15:27:02
Please help in writing the query to get the output.

Table1:

Fld1 Fld2 Fld3 Fld4
----------------------------------------------
1 1988 5487 2004-08-05 00:00:00.000
1 1988 5675 2006-08-05 00:00:00.000


Table2:

Fld1 Fld2 Fld3
--------------------
2 1988 256
2 1988 250



Output:

Fld1 Fld2 Fld3 Fld4 Fld1 Fld2 Fld3
--------------------------------------------------------------------
1 1988 5487 2004-08-05 00:00:00.000 2 1988 256
1 1988 5675 2006-08-05 00:00:00.000 2 1988 250

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-11 : 15:32:20
on which columns can you join on?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-11 : 15:34:37
so is field2 the only common column between the tables? can you post more data from the tables? if the field 2 is the only FK you might get more than 1 row for each row in table1.

Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -