Solved

want products.pdescription

Posted on 2011-02-21
3
279 Views
Last Modified: 2012-05-11
I want to see products.pdescription (text) for each product


when i add this line
p.pdescription,

I get error
Msg 8156, Level 16, State 1, Line 1
The column 'pdescription' was specified multiple times for 't1'.




select * from (
select pi.packageitemid,pi.packageid,pi.active packageitems_active,p.*,
       
sd.pathid,
sd.accessoryid,
sd.alternatecolors,
sd.description,
sd.specifications,
sd.features,
sd.itemincludes,
sd.accessories,
sd.infoandguides,
sd.rebateinfo,
sd.sunshineactive,
sd.sunshineprice,
sd.sunshinefeed,
sd.pyxisactive,
sd.pyxisprice,
sd.pyxisfeed,
sd.hdewactive,
sd.hdewprice,
sd.hdewfeed,
sd.shippingtype,
sd.shippingpriceground,
sd.shippingprice3day,
sd.shippingprice2day,
sd.shippingprice1day,
sd.shippingpricetruck,
sd.shippingpricetruckexpress,
sd.shippingpricetruckwhite,
sd.pyxispackages,
sd.sunpackages,
sd.ebaydescription,
p.pdescription,
       pi1.productimagesid,pi1.name, -- keep only the columns you required
       count(*) over (partition by pi.productid) productid_cnt,
       ROW_NUMBER() over (partition by pi.productid order by p.price desc) rn
  from packageitems pi
  left join products p on p.productid=pi.productid
 left join sitedata sd on sd.productid=pi.productid  
 left join (select productid,max(productimagesid) productimagesid from productimages group by productid) i on i.productid=p.productid
  left join productimages pi1 on p.productid=pi1.productid and pi1.productimagesid = i.productimagesid
 where pi.packageid=4935) t1
 where rn=1
and productid is not null
order by price desc
0
Comment
Question by:rgb192
3 Comments
 
LVL 22

Accepted Solution

by:
Om Prakash earned 350 total points
ID: 34948944
You have used p.* and also want  to use p.pdescription which will give you above error.

Instead of p.*, specify the field names that you need.
0
 
LVL 13

Assisted Solution

by:agarwalrahul
agarwalrahul earned 150 total points
ID: 34949296
Specify either column names or put * in the select statement, do not use

Select * and column names both
for the same table because this gives the same

error "The column 'Column Name' was specified multiple times"
0
 

Author Closing Comment

by:rgb192
ID: 34953143
thanks
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question