how to compare one column values of table with another table multiple column values

Posted by Raj_chennai under Sql Server on 1/17/2012 | Points: 10 | Views : 1619 | Status : [Member] | Replies : 1
a table contains customer complaint feedback in one column and then another table contains product details. i need to match up complaint feedback column with product details table multiple columns such as product name,product id,product model

raj


Responses

Posted by: Naraayanan on: 2/1/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Raj,
map the Two tables like this,
Customer Complaint and Feedback against for Product ID.
If you table like this,
tbl_productfeedback
Columns:
ProductId
CustomerID
Complaints
Feedback
tbl_Productdetails
Columns:
ProductId
ProductName
ProductModel

So your query likes this
Select distinct a.ProductId,a.ProductName,a.productModel,b.complaints,b.Feedback from  tbl_productfeedback b,tbl_Productdetails a where a.ProductId=b.productId order by a.ProductId



I hope this will help you.

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Raj_chennai, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response