設表名爲TABLENAME,字段名爲FIELD1則: SELECT FIELDN = FIELD1 FROM TABLENAME WHERE NOT EXISTS ( SELECT FIELD1 FROM TABLENAME A WHERE A.FIELD1 = tablename.field1 + 1 ) UNION SELECT FIELDN = FIELD1 FROM TABLENAME WHERE NOT EXISTS ( SELECT FIELD1 FROM TABLENAME A WHERE A.FIELD1 + 1 = tablename.field1 ) ORDER BY FIELDN