Giriş
Açıklaması şöyle
ÖrnekROWNUM is a pseudocolumn (not a real column) that is available in a query. ROWNUM will be assigned the numbers 1, 2, 3, 4, ... N , where N is the number of rows in the set ROWNUM is used with. A ROWNUM value is not assigned permanently to a row (this is a common misconception). A row in a table does not have a number; you cannot ask for row 5 from a table—there is no such thing.Also confusing to many people is when a ROWNUM value is actually assigned. A ROWNUM value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation. Also, a ROWNUM value is incremented only after it is assigned,...
Sort işleminden sonra rownum verildiğini görmek için şöyle yaparız
SELECT ROWNUM, customers.*FROM customersWHERE customer_id > 4500;ROWNUM CUSTOMER_ID LAST_NAME FIRST_NAME FAVORITE_WEBSITE------ ----------- --------- ---------- ---------------------1 5000 Smith Jane www.digminecraft.com2 6000 Ferguson Samantha www.bigactivities.com3 7000 Reynolds Allen www.checkyourmath.com4 8000 Anderson Paige5 9000 Johnson Derek www.techonthenet.comSELECT ROWNUM, customers.*FROM customersWHERE customer_id > 4500ORDER BY last_name;ROWNUM CUSTOMER_ID LAST_NAME FIRST_NAME FAVORITE_WEBSITE------ ----------- --------- ---------- ---------------------4 8000 Anderson Paige2 6000 Ferguson Samantha www.bigactivities.com5 9000 Johnson Derek www.techonthenet.com3 7000 Reynolds Allen www.checkyourmath.com1 5000 Smith Jane www.digminecraft.com
Hiç yorum yok:
Yorum Gönder