A pseudocolumn or Pseudo-column is like a table column but it actually not exist or sotred in the table, so you can select from pseudocolumns to read its value but you can't insert, update or delete their values.
Examples:
The table employees has only 3 columns as we can see by using description command
1
2
3
4
5
6
| SQL> desc employees;
Name Null? Type
-----------------------------
ID NUMBER
NAME VARCHAR2(20)
SALARY NUMBER(7,2) |
1
2
3
4
5
6
7
8
9
10
11
12
| SQL> select ID,NAME,SALARY from employees;
ID NAME SALARY
-------
190 Thomas 3500
253 Abraham 2700
262 Charlie 2700
267 Louis 2850
182 John 3000
520 William 2700
6 rows selected. |
ROWNUM:
returns a number indicating the order in which a row was selected from a table.
1
2
3
4
5
6
7
8
9
10
11
12
| SQL> select ROWNUM,ID,NAME,SALARY from employees;
ROWNUM ID NAME SALARY
-------
1 190 Thomas 3500
2 253 Abraham 2700
3 262 Charlie 2700
4 267 Louis 2850
5 182 John 3000
6 520 William 2700
6 rows selected. |
ROWNID:
returns the address in the database of each row was selected from a table.
1
2
3
4
5
6
7
8
9
10
11
12
| SQL> select ROWID,ID,NAME,SALARY from employees;
ROWID ID NAME SALARY
----------------
AAADYsAAEAAAAD1AAA 190 Thomas 3500
AAADYsAAEAAAAD1AAB 253 Abraham 2700
AAADYsAAEAAAAD1AAC 262 Charlie 2700
AAADYsAAEAAAAD1AAD 267 Louis 2850
AAADYsAAEAAAAD1AAE 182 John 3000
AAADYsAAEAAAAD1AAF 520 William 2700
6 rows selected. |
If this post was good and helpful for you, Please give it Like.
0 comments:
Post a Comment