Glowworm27
Programmer
I have a table of records that contain a field of descriptions of products.
I want to query the table descriptions, looking for a list of numbers. The numbers are contained in another table and I an only looking for certain numbers.
So lets say table 1 (productdescrptions) data contains
Rec_Id(integer), Description(varchar2)
1, 'part 123 a wheel'
2, 'part 234 a brakepad'
3, 'part 456 a muffler'
4, 'part 567 a bolt'
(the data is hypathetical but you get the idea)
table 2 (partnumbers) contains just part numbers, and part codes
Rec_Id(interger), PartNumber(varchar2), partcode(integer)
1, '123', 1
2, '234', 1
3, '456', 2
4, '567', 3
I want to return only records from table 1 (productdescription) where the description matches the Partnumber from table 2(partnumbers) with a partcode of 1
The list sql would look something like this
<Select Partnumber from Partnumbers where partcode =1>
and using the data above would return 2 records
'123','234'
and I want to find records in table 1(partdescription) where the descrpition may be a partial match to the list
such as
<Select * from Partdescriprion where description like '%123%'>
but use every item in the list returned from the table 2 query, '123', and '234'
I was thinking a cursor of sorts, but just want a sql i can execute to return the records.
I hope i didn't confuse anyone to badly
Peace
George Oakes
Check out this awsome .Net Resource!
I want to query the table descriptions, looking for a list of numbers. The numbers are contained in another table and I an only looking for certain numbers.
So lets say table 1 (productdescrptions) data contains
Rec_Id(integer), Description(varchar2)
1, 'part 123 a wheel'
2, 'part 234 a brakepad'
3, 'part 456 a muffler'
4, 'part 567 a bolt'
(the data is hypathetical but you get the idea)
table 2 (partnumbers) contains just part numbers, and part codes
Rec_Id(interger), PartNumber(varchar2), partcode(integer)
1, '123', 1
2, '234', 1
3, '456', 2
4, '567', 3
I want to return only records from table 1 (productdescription) where the description matches the Partnumber from table 2(partnumbers) with a partcode of 1
The list sql would look something like this
<Select Partnumber from Partnumbers where partcode =1>
and using the data above would return 2 records
'123','234'
and I want to find records in table 1(partdescription) where the descrpition may be a partial match to the list
such as
<Select * from Partdescriprion where description like '%123%'>
but use every item in the list returned from the table 2 query, '123', and '234'
I was thinking a cursor of sorts, but just want a sql i can execute to return the records.
I hope i didn't confuse anyone to badly
Peace
George Oakes
Check out this awsome .Net Resource!