?
Solved

want products.pdescription

Posted on 2011-02-21
3
Medium Priority
?
286 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 1400 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:Rahul Agarwal
Rahul Agarwal earned 600 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

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