Query returning different results for desktop client and phpMyAdmin

Viewed 30

This is using mysql 5.7.33

SELECT
    CASE WHEN checkin_date=@last_ci+INTERVAL 1 DAY THEN @n ELSE @n:=@n+1 END AS g,
    @last_ci := checkin_date As checkin_date,
    calendar_id
FROM (
        select 1 calendar_id, '2021-04-10' checkin_date union all
        select 1, '2021-04-20' union all
        select 1, '2021-04-21' union all
        select 1, '2021-04-22' union all
        select 1, '2021-04-25'
   ) x,
   (SELECT @n:=0) r
ORDER BY checkin_date

This is the correct result which is returned by HeidiSql (11.1.x)

enter image description here

and the same query performed by phpMyAdmin gives bogus g column (php 7.x)

enter image description here

What can I do to get the same output with phpMyadmin?

0 Answers
Related