Select runs. I am trying to change the update but does not work. Who knows help me?
select
concat(
'Вы можете приобрести "', pd.name, '" с гарантией от производителя',
' "', max(case when ad.attribute_id=2 then ad.name end), '" ',
' "', max(case when ad.attribute_id=2 then pa.text end), '" ',
' и ',
' "', max(case when ad.attribute_id=3 then ad.name end), '" ',
' "', max(case when ad.attribute_id=3 then pa.text end), '" ')
from
oc_product_description pd
inner join oc_product_to_category pc on pd.product_id=pc.product_id
inner join oc_product_attribute pa on pd.product_id=pa.product_id and pd.language_id=pa.language_id
inner join oc_attribute_description ad on pa.attribute_id=ad.attribute_id and pa.language_id=ad.language_id
where
pd.language_id=4
and pa.attribute_id in (2,3)
and pc.category_id=121
and pd.product_id = 102
my updates, i have error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group by pd.name' at line 22
UPDATE `oc_product_description` pd
inner join oc_product_attribute pa on pd.product_id=pa.product_id and
pd.language_id=pa.language_id
inner join oc_attribute_description ad on pa.attribute_id=ad.attribute_id and
pa.language_id=ad.language_id
inner join oc_product_to_category pc on pc.product_id=pa.product_id
set pd.`description`= concat(
'Вы можете приобрести ', pd.name, ' с гарантией от производителя',
' ', max(case when ad.attribute_id=2 then ad.name end), ' ',
' ', max(case when ad.attribute_id=2 then pa.text end), ' ',
' и ',
' ', max(case when ad.attribute_id=3 then ad.name end), ' ',
' ', max(case when ad.attribute_id=3 then pa.text end), ' ')
where pd.language_id=4
and pa.attribute_id in (2,3)
and pc.category_id = 121
and pa.product_id = 102
group by pd.name
i did it!