[SOLVED] syntex error in mysql where use partation method


select \*, SUM(day_diffrence) as unavailablity from ( select id,variant_id,date,quantity,product_title,variant_title,sku, datediff(day,lag(date,-1) over ( partition by variant_id order by date asc),date) as day_diffrence from sku_wise_unavailablity ) as T where T.quantity = 0 group by variant_id

enter image description here

show error in above image in mysql 5.6 version when i try this query in mariaDB 10.4 its working fine


MariaDB-10.4 supports window functions (10.2+ actually) and MySQL-5.6 doesn’t.

Answered By – danblack

Answer Checked By – Marie Seifert (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *