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)
 2 Tables without relations

Author  Topic 

abacusdotcom
Posting Yak Master

133 Posts

Posted - 2005-04-23 : 10:06:32
Hi,
Can I join two tables together without relations?
I execute this sample code.

SELECT
MasterFile.FileID,
BenchMarkConf.*
FROM
MasterFile,
BenchMarkConf

what other ways can i use?
Thanks,
Lekan

I sign for fame not for shame but all the same, I sign my name.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-04-23 : 11:16:21
If two tables don't have any related columns, why would you want to join them?

If there is another table(s) that could act as an "association" table you could use them.



Be One with the Optimizer
TG
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2005-04-24 : 06:28:46
When you do a select from two tables without specifying a join condition, you are still doing a join: a CROSS JOIN. Your query would produce the same results as:

SELECT
MasterFile.FileID,
BenchMarkConf.*
FROM
MasterFile CROSS JOIN
BenchMarkConf

Of course, why you would want to do something like this is beyond me, but if you can elaborate on your business requirement, we might be able to help you find a solution.

OS
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-04-25 : 07:34:19
(In my best anouncer voice)
This sounds Like a job for Dr. Cross join!


Ok Jeff Jump in here.

Jim
Users <> Logic
Go to Top of Page
   

- Advertisement -