select g.goods_id, g.goods_name, g.cat_id, a.attr_id, a.attr_name, ga.attr_value, ga.attr_price from ecs_goods as g, ecs_attribute as a, ecs_goods_attr as ga where (g.cat_id in ('1') or g.goods_id in ('')) and g.goods_id = ga.goods_id and a.attr_id = ga.attr_id and g.is_delete = 0 and g.is_on_sale = 1 and g.is_alone_sale = 1 order by g.goods_id desc, a.attr_id asc, ga.goods_attr_id asc;
select g.goods_id, g.goods_name, g.cat_id, a.attr_id, a.attr_name, ga.attr_value, ga.attr_price from ecs_goods as g, ecs_attribute as a, ecs_goods_attr as ga where (g.cat_id in ('1') or g.goods_id in ('')) and g.goods_id = ga.goods_id and a.attr_id = ga.attr_id and a.attr_id = 221 and g.is_delete = 0 and g.is_on_sale = 1 and g.is_alone_sale = 1 order by g.goods_id desc, a.attr_id asc, ga.goods_attr_id asc;