Mysql
 sql >> Datenbank >  >> RDS >> Mysql

wie man dem vorkommen in sql eine nummer gibt

SELECT  t1.ID
,       t1.Name
        (
        SELECT  COUNT(t2.ID)
        FROM    tablename AS t2
        WHERE   t1.Name = t2.Name
                and t2.ID <= t1.ID
        ) AS 'Visit times'
FROM    tablename AS t1;