2014-01-27 59 views

回答

2

你可以有一個相關子查詢,其順序計數可以用作ROWNUMBER行。

SELECT A.ID, 
     A.plate_number, 
     (
      SELECT COUNT(*) 
      FROM tableName c 
      WHERE c.plate_number = a.plate_number AND 
        c.ID <= a.ID) AS RowNumber 
FROM TableName a 
+0

酷,非常酷... – Ikong