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 |
|
zippy
Yak Posting Veteran
69 Posts |
Posted - 2001-10-10 : 19:25:10
|
| Hi,I am trying to do a SELECT using sets and 2 tables.My two tables are as followsocManufacturersManufacturerID INTManufacturerName VARCHAR(20)CategoryID VARCHAR(20)ocSystemsCategoriesCateogryID INTCategoryName VARCHAR(20)the CategoryID is VARCHAR in ocManufacturers because it contains a string of comma delimited id's so that each manufacturer can belong to more than one category.I am trying to do this SELECTSELECT dbo.ocManufacturers.ManufacturerID, dbo.ocManufacturers.ManufacturerName, dbo.ocSystemsCategories.CategoryNameFROM dbo.ocSystemsCategories CROSS JOIN dbo.ocManufacturersWHERE (dbo.ocSystemsCategories.CategoryID IN (dbo.ocManufacturers.CategoryID))my problem is that it WHERE clause doesnt like comparing INT values to VARCHAR, I thought that this would be ok?is there a way to convert it to a VARCHAR and then compare them?The INT (ocSystemsCategories.CategoryID) value is an identity field and I dont want to have to turn it offSecond probelm is that when I convert ocSystemsCategories.CategoryID to a VARCHAR the select works but only returns recors with 1 item in ocManufacturers.CategoryIDhelp would be great!!Check out the worlds fastest computers at http://www.ocgurus.com |
|
|
|
|
|