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
 Transact-SQL (2000)
 Wierd Join

Author  Topic 

tpayne
Starting Member

18 Posts

Posted - 2010-06-22 : 11:23:38
I have 2 tables
PIC_NUMBER
PIC_NUMBER_ID INTEGER,
CSA VARCHAR(20),
PIC_NUMBER VARCHAR(30),
RANGE_ID INTEGER
PIC_NUMBER_RANGE
PIC_NUMBER_RANGE_ID INTEGER,
MAX_PIC_NUMBER VARCHAR(30),
MIN_PIC_NUMBER VARCHAR(30)

FOREIGN KEY PIC_NUMBER_RANGE_ID = RANGE_ID.

pic_number table has individual pic_numbers and all the pic_number that are between max and min on the range table related by the range_id field to range table.

I need a query that will return all Pic_number.pic_number where range_id is null
and only distinct min and max from pic_number_range where range_id's
match.

Weird I know.

thanks.

SD_Monkey
Starting Member

38 Posts

Posted - 2010-06-27 : 11:58:11
can you post your sample data...

and please detail your table information...

A maze make you much more better
Go to Top of Page
   

- Advertisement -