Hi all
I am trying to retrieve information from various tables. That was the easy part. But, one of the fields I would like to return distinct, as the same data can be repeated more than once. Here is my code, this part of it works:
select cat.catregid, s.companyname, cat.supplierID, p.productID, c.catname, c.catcode,
p.name, cat.division from suppliermain s
join catregistration cat on s.supplierID = cat.supplierID
join product p on p.catregID = cat.catregID
join categories c on p.category = c.catcode
where contains (p.description, 'nails') OR p.name = 'nails'
order by s.companyname
I would like it to return the companyname only once. Any assistance in this is greatly appreciated!
Thanks
allyeric
[sig][/sig]
I am trying to retrieve information from various tables. That was the easy part. But, one of the fields I would like to return distinct, as the same data can be repeated more than once. Here is my code, this part of it works:
select cat.catregid, s.companyname, cat.supplierID, p.productID, c.catname, c.catcode,
p.name, cat.division from suppliermain s
join catregistration cat on s.supplierID = cat.supplierID
join product p on p.catregID = cat.catregID
join categories c on p.category = c.catcode
where contains (p.description, 'nails') OR p.name = 'nails'
order by s.companyname
I would like it to return the companyname only once. Any assistance in this is greatly appreciated!
Thanks
allyeric
[sig][/sig]