-

Select bmam.brand_media_article_id, brand_media_article_headline, brand_media_article_headline as headline, bmam.brand_media_article_headline as homepage_headline, bmam.brand_media_article_meta_title as page_title, bmam.brand_media_article_keywords as keywords, brand_media_article_headline, brand_media_article_page_url, brand_media_article_description,category_name, sub_category_name, brand_media_article_date, brand_media_article_time_r, brand_media_article_date1, brand_media_article_time, brand_media_article_date as date, brand_media_article_time_r as time_r, brand_media_article_date1 as date1, brand_media_article_time as time, brand_media_article_tags, brand_media_article_location, brand_media_article_meta_title, brand_media_article_meta_description, brand_media_article_meta_description as meta_description, brand_media_article_keywords, brand_media_article_image, brand_media_article_image as image, brand_media_article_image2, brand_media_article_image1, brand_media_article_image_caption, brand_media_article_video_id,brand_media_article_image_caption as image_caption, brand_media_article_banner_d,brand_media_article_banner_d_url,brand_media_article_banner_d1,brand_media_article_banner_d1_url,brand_media_article_banner_m,brand_media_article_banner_m_url,is_ai_sponsored_tag,brand_media_article_banner_m1,brand_media_article_banner_m1_url,brand_media_article_epoch,brand_media_article_byline, brand_media_article_edited_by, bmam1.author_id as author1_id,bmam1.author_email as author1_email, if((select bmaml.brand_media_article_id from brand_media_article_master bmaml where bmaml.category_name=bmam.category_name and bmaml.sub_category_name=bmam.sub_category_name and bmaml.active='Y' order by bmaml.brand_media_article_id desc limit 1)=1754, 'last', 'not_last') as is_last, (Select bmam3.brand_media_article_id from brand_media_article_master bmam3 Where bmam3.brand_media_article_id>bmam.brand_media_article_id and bmam3.category_name=bmam.category_name AND CASE WHEN bmam.sub_category_name IS NOT NULL THEN bmam3.sub_category_name=bmam.sub_category_name ELSE TRUE END and bmam3.active='Y' order by bmam3.brand_media_article_id ASC LIMIT 0,1) as next_brand_media_article_id, (Select bmam4.brand_media_article_page_url from brand_media_article_master bmam4 Where bmam4.brand_media_article_id>bmam.brand_media_article_id and bmam4.category_name=bmam.category_name AND CASE WHEN bmam.sub_category_name IS NOT NULL THEN bmam4.sub_category_name=bmam.sub_category_name ELSE TRUE END and bmam4.active='Y' order by bmam4.brand_media_article_id ASC LIMIT 0,1) as next_brand_media_article_page_url, (Select bmam5.brand_media_article_headline from brand_media_article_master bmam5 Where bmam5.brand_media_article_id>bmam.brand_media_article_id and bmam5.category_name=bmam.category_name AND CASE WHEN bmam.sub_category_name IS NOT NULL THEN bmam5.sub_category_name=bmam.sub_category_name ELSE TRUE END and bmam5.active='Y' order by bmam5.brand_media_article_id ASC LIMIT 0,1) as next_brand_media_article_headline from brand_media_article_master bmam left join author_master bmam1 on bmam.brand_media_article_byline=bmam1.author_name and bmam1.active='Y' where bmam.brand_media_article_id=1754 and bmam.active='Y'

Error