get without duplicate values columns and with duplicatevalues colums

Posted by Ramakrishna188 under Sql Server on 5/25/2012 | Points: 10 | Views : 1003 | Status : [Member] | Replies : 2
hi all
my requirement is i have one table in this table having ProductId,ClientMailId,ProductName,ProductDescription,
ProductCost,ProductDiscount,CategoryName,SubCategoryName,ProductImage,DateAdded,Status,ProductCity,ProductLocations,
CreatedBy,AdminStatus. i want to dispaly without duplicate values of SubcategoryName,and with duplicate values
of ProductId,ProductImage,ProductCost,ProductDiscount.please help me.

thankyou.




Responses

Posted by: Sekar.C on: 5/25/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Select ProductId,ClientMailId,ProductName,ProductDescription,ProductCost,ProductDiscount,CategoryName, DISTINCT(SubCategoryName),ProductImage,DateAdded,Status,ProductCity,ProductLocations,CreatedBy,AdminStatus from table1


Regards
Sekar.c

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

Posted by: Sriramnandha on: 5/25/2012 [Member] Starter | Points: 25

Up
0
Down
Select ProductId,ClientMailId,ProductName,ProductDescription,ProductCost,ProductDiscount,CategoryName, DISTINCT(SubCategoryName),ProductImage,DateAdded,Status,ProductCity,ProductLocations,CreatedBy,AdminStatus where productid not in
(
Select ProductId,ClientMailId,ProductName,ProductDescription,ProductCost,ProductDiscount,CategoryName, SubCategoryName,ProductImage,DateAdded,Status,ProductCity,ProductLocations,CreatedBy,AdminStatus group by productid
having count(*)<1)

regards


sriram

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

Login to post response