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)
 Joining two unrelated tables

Author  Topic 

kaustubh
Starting Member

4 Posts

Posted - 2005-06-13 : 10:37:52
Hey!

I have a view which returns me a column (lets say colA) with values like 0.85, 1.95, 1.09 etc.

Then i have a table which contains a RangeId's for colA values, with ranges like..

RangeID colA_UpperLimit colA_LowerLimit

01 0.50 1.50
02 1.51 2.01
03 2.02 3.52

How do i get the colA values with the corresponding RangeId's in one view?
There is no relation between the two tables.

I have already tried the following:

SELECT T.RangeID, V.ColA
FROM viewColA V
LEFT JOIN tableRange T ON V.ColA BETWEEN T.colA_UpperLimit AND T.colA_LowerLimit

I get a voilation error.

Thanks everyone!

There is no unanswered reply!

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-06-13 : 12:04:37
post the DDLs for tables and view. Post the exact error msg.

btw: your BETWEEN should list the lower limit first (between LowerLimit and UpperLimit)

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -