5
MySQL-在选择时获取行号
如果项目已排序,是否可以运行select语句并获取行号? 我有一个这样的表: mysql> describe orders; +-------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------------------+------+-----+---------+----------------+ | orderID | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | itemID | bigint(20) unsigned | NO | | NULL | | +-------------+---------------------+------+-----+---------+----------------+ 然后,我可以运行此查询以按ID获取订单数量: SELECT itemID, …
181
mysql
sql
row-number