Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

incorrect syntax near the keyword 'as'

Posted on 2010-11-18
4
Medium Priority
?
951 Views
Last Modified: 2012-05-10
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'as'.
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'as'.
SELECT p.productid, p.titleinternal,p.ebaytitle, p.model, p.mpn
, p.internalsku1, p.internalsku2,p.internalsku3p.inwarehouse1
,p.auk1,p.ny1,p.ourinwarehouse1,p.sentquantity1,p.cost1,p.skucount1 
,p.inwarehouse2,p.auk2,p.ny2,p.ourinwarehouse2,p.sentquantity2,p.cost2,p.skucount2 
,p.inwarehouse3,p.auk3,p.ny3,p.ourinwarehouse3,p.sentquantity3,p.cost3,p.skucount3 
,p.inwarehouse4,p.auk4,p.ny4,p.ourinwarehouse4,p.sentquantity4,p.cost4,p.skucount4
,p.asin,sd.accessories as accessories,sd.pyxisprice as price, sd.pathid as pathid
, datalength(sd.features) as fl, datalength(sd.specifications) as sl
, datalength(sd.itemincludes) as il, datalength(sd.ebaydescription) as ed
, (SELECT COUNT(*) FROM productspecifics WHERE productid = p.productid) as specs
, (SELECT COUNT(*) FROM productimages WHERE productid = p.productid) as imgs 
FROM products p 
left join sitedata sd 
  on p.productid = sd.productid 
WHERE p.folderid = '' 
AND p.active = '1' 
ORDER BY titleinternal

Open in new window

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
4 Comments
 
LVL 8

Expert Comment

by:Coralie Crumrine
ID: 34168722
Looks like you need a space
You have:
p.skucount4 p.asin,sd.accessories as accessories,

and it should be
p.skucount4 as in,sd.accessories as accessories,
0
 
LVL 4

Expert Comment

by:patterned
ID: 34168741
SELECT p.productid, p.titleinternal,p.ebaytitle,p.model,p.mpn,p.internalsku1,p.internalsku2,
p.internalsku3,p.inwarehouse1,p.auk1,p.ny1,p.ourinwarehouse1,p.sentquantity1,p.cost1,p.skucount1,
p.inwarehouse2,p.auk2,p.ny2,p.ourinwarehouse2,p.sentquantity2,p.cost2,p.skucount2,
p.inwarehouse3,p.auk3,p.ny3,p.ourinwarehouse3,p.sentquantity3,p.cost3,p.skucount3,
p.inwarehouse4,p.auk4,p.ny4,p.ourinwarehouse4,p.sentquantity4,p.cost4,
p.skucount4,p.asin,sd.accessories as accessories,sd.pyxisprice as price,sd.pathid as pathid, datalength(sd.features) as fl,
datalength(sd.specifications) as sl, datalength(sd.itemincludes) as il,datalength(sd.ebaydescription) as ed,
(SELECT COUNT(*) FROM productspecifics WHERE productid = p.productid) as specs,
(SELECT COUNT(*) FROM productimages WHERE productid = p.productid) as imgs

FROM products p left join sitedata sd on p.productid = sd.productid
WHERE p.folderid = '' AND p.active = '1' ORDER BY titleinternal


Try that?  Looks like you missed a couple commas.
0
 
LVL 12

Accepted Solution

by:
Nathan Riley earned 2000 total points
ID: 34168772
Fixed:

SELECT p.productid,
p.titleinternal,
p.ebaytitle,
p.model,
p.mpn,
p.internalsku1,
p.internalsku2,
p.internalsku3,
p.inwarehouse1,
p.auk1,
p.ny1,
p.ourinwarehouse1,
p.sentquantity1,
p.cost1,
p.skucount1,
p.inwarehouse2,
p.auk2,
p.ny2,
p.ourinwarehouse2,
p.sentquantity2,
p.cost2,
p.skucount2,
p.inwarehouse3,
p.auk3,
p.ny3,
p.ourinwarehouse3,
p.sentquantity3,
p.cost3,
p.skucount3,
p.inwarehouse4,
p.auk4,
p.ny4,
p.ourinwarehouse4,
p.sentquantity4,
p.cost4,
p.skucount4,
p.asin,
sd.accessories as accessories,
sd.pyxisprice as price,
sd.pathid as pathid,
datalength(sd.features) as fl,
datalength(sd.specifications) as sl,
datalength(sd.itemincludes) as il,
datalength(sd.ebaydescription) as ed,
(SELECT COUNT(*) FROM productspecifics WHERE productid = p.productid) as specs,
(SELECT COUNT(*) FROM productimages WHERE productid = p.productid) as imgs
FROM products p
left join sitedata sd on p.productid = sd.productid
WHERE p.folderid = '' AND p.active = '1' ORDER BY titleinternal
0
 

Author Closing Comment

by:rgb192
ID: 34169758
thanks
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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