Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL - Seleziona il numero di riga di un record

Prova questo forse:

SET @rownum = 0;
SELECT id 
FROM (SELECT *, @rownum:[email protected] + 1 AS id FROM dict ORDER BY words) d
WHERE d.words LIKE CONCAT('c','%')

Come singola query, prova questo:

SELECT id 
FROM (SELECT *, @rownum:[email protected] + 1 AS id FROM dict, (SELECT @rownum:=0) r ORDER BY words) d
WHERE d.words LIKE CONCAT('c','%')