BEST ART SELECTION IN COLOGNE

FEATURED ARTWORKS

ARTISTS

SELECT DISTINCT A1.`artwork_id`,
A2.`artist_id`, A2.`artist_name`,
T.`technique_id`,
C.`category_id`, C.`category_name_en`,
A1.`category2_id`, A1.`show_in_homepage`, A1.`show_in_artists_list`,
A1.`artwork_title`, A1.`artwork_url`, A1.`artwork_photo`,
A1.`artwork_width`, A1.`artwork_height`, A1.`artwork_depht`,
A1.`artwork_width_in`, A1.`artwork_height_in`, A1.`artwork_depht_in`,
A1.`artwork_price`, A1.`price_visible`, A1.`has_shadow`, A1.`artwork_active`, A1.`artwork_added`,
A1.`artwork_year_creat`, A1.`show_in_shop`, A1.`default_room`,
A1.`artwork_ext_amount`, A1.`artwork_ext_descript`,
A1.`ext_refgallery`, A1.`ext_refartist`, A1.`artwork_above`, A1.`artwork_curated`,
A1.`headquarter_id`,
(SELECT COUNT(AV.`artwork_view_id`)
FROM `artworks_views` AV
WHERE AV.`artwork_id` = A1.`artwork_id`) AS views,
O.`request_type` AS ordered_status,
S.`sale_payment`, S.`sale_paid`, S.`sale_id`, SI.`clearing_status`
FROM `artworks` A1
INNER JOIN `artists` A2 ON A2.`artist_id` = A1.`artist_id`
AND A2.`artist_active` = 'Y'
LEFT OUTER JOIN `artworks_techniques` T ON T.`artwork_id` = A1.`artwork_id`
LEFT OUTER JOIN `categories` C ON C.`category_id` = A1.`category_id`
LEFT OUTER JOIN `artworks_colors` AC ON AC.`artwork_id` = A1.`artwork_id`
LEFT OUTER JOIN `orders_items` OI ON OI.`artwork_id` = A1.`artwork_id`
LEFT OUTER JOIN `orders` O ON O.`order_id` = OI.`order_id`
AND O.`order_state` <> 'C'
LEFT OUTER JOIN `sales_items` SI ON SI.`artwork_id` = A1.`artwork_id` AND
SI.`active` = 1
LEFT OUTER JOIN `sales` S ON S.`sale_id` = SI.`sale_id`
WHERE (1
AND A1.`artwork_active` = 'Y'
AND A1.`artist_id` = 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 ')' at line 33