查询test表中id为16的记录是第几行的两个方法 MySQL mysql select count(*) from test where id = (select id from test where id=16); +----------+| count(*) |+----------+| 1 |+----------+1 row in set (0.00 sec) mysql select count(*) from test wher
查询test表中id为16的记录是第几行的两个方法 MySQLmysql> select count(*) from test where id <= (select id from test where id=16); +----------+ | count(*) | +----------+ | 1 | +----------+ 1 row in set (0.00 sec)
mysql> select count(*) from test where id <= 16; +----------+ | count(*) | +----------+ | 1 | +----------+ 1 row in set (0.00 sec)