Solved

want products.pdescription

Posted on 2011-02-21
3
285 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

707 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