concat - SQL Query interrogation issue (Subquery returns more than 1 row) -
this query :
select max(c.categoryid) catid, c.entityid, p.productid, pd.productname, cd.name categorie, pd.description, pd.metatitle, pd.metadescription, sum(p.price) price, sum(p.stoc) stoc, p.isactive, max(case when fd.fieldname='volum' textvalue else null end) volum, max(case when fd.fieldname='tip inchidere' textvalue else null end) tipinchidere, max(case when fd.fieldname='ambalare palet' textvalue else null end) ambalarepalet, max(case when fd.fieldname='ambalare bax' textvalue else null end) ambalarebax, concat('http://www.borcane.ro/images/',img.parenttype,'/', lpad(p.productid,8,'0'),'/',lpad(img.id,8,'0'),'_large.jpg'), ( select concat('http://www.borcane.ro/images/',img2.parenttype,'/',lpad(p.productid,8,'0'),'/',lpad(img2.id,8,'0'),'_large.jpg') images_images img2 ) imagelinks products_products p left bring together products_products_details pd on pd.productid = p.productid left bring together fld_chosenvalues f on f.productid = p.productid inner bring together fld_fields_details fd on f.fieldid = fd.fieldid inner bring together g_categories_relations c on p.productid = c.entityid inner bring together g_category_details cd on c.categoryid = cd.id inner bring together images_images img on img.parentid = p.productid pd.locale = 'ro-ro' , fd.locale = 'ro-ro' , cd.locale = 'ro-ro' grouping p.productid, pd.productname, p.isactive
so problem here : concat('http://www.borcane.ro/images/',img2.parenttype,'/',lpad(p.productid,8,'0'),'/',lpad(img2.id,8,'0'),'_large.jpg')
returns more 1 element, know that, want in order homecoming me of result, want of result in 1 row. example:
this case not returns numbers, concatanion result. how can ?
sql concat
No comments:
Post a Comment