Solved

want products.pdescription

Posted on 2011-02-21
3
277 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

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 …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now