View Single Post
Old 07-12-2012, 06:20 PM   PM User | #5
alykins
Senior Coder

 
alykins's Avatar
 
Join Date: Apr 2011
Posts: 1,608
Thanks: 37
Thanked 183 Times in 182 Posts
alykins will become famous soon enough
Code:
select P2.voltage,V.voltage voltage2,count(*) as KOL -- missing a comma between V.voltage, voltage2 and an alias identifier ie P2.voltage2 or V.voltage2
from Lights_America..temp_products P2  -- two .'s in this line Lights_America.temp_products
left join  voltage V on (P2.voltage=V.id) 
left join excludedproducts E on (E.storeid=9 and E.id=P2.id)  
where  P2.id > 0  
	and voltage in (1)  
	and manufacturer_name in (143,135,153,171,151,217,184,185,181,179,183,175,150,123,130,129,121,
								128,18,14,66,37,77,65,11,68,46,60,43,41,45,108,38,98,40,26,48,25,28,
								42,62,13,9,30,39,70,47,64,74,116,33,97,12,107,101,16,29,57,59,7,15,71,1,72,
								54,10,19,51,53,35,69,114,118,17,67,52,63,34,102,76,31,191,188,190,133,134,
								194,196,160,159,163,209,216,213,214,211,139,58,208,204,168,166,142,165,164,138,140)  
	and isnull(E.exc,0)<1 
group by P2.voltage,V.voltage 
order by voltage2
__________________

I code C hash-tag .Net
Reference: W3C W3CWiki .Net Lib
Validate: html CSS
Debug: Chrome FireFox IE
alykins is offline   Reply With Quote