PostgreSQL

Скачать в pdf «PostgreSQL»

FROM friend;


firstname


| lastname


| city


|


state


|


age


Mike


| Nichols


| Tampa


|


FL


|


19


Cindy


| Anderson


| Denver


|


CO


|


23


Sam


| Jackson


| Allentown


|


pa


|


22


(3 rows)

test=> UPDATE friend SET age = 20 WHERE firstname = ‘Mike’; UPDATE 1


test=> SELECT * firstname


FROM friend;


| lastname


| city


| state


| age


Cindy


| Anderson


| Denver


| CO


| 23


Sam


| Jackson


| Allentown


| PA


| 22


Mike


| Nichols


| Tampa


| fl


| 20

(3 rows)


Figure 3.13: My first update


test=> SELECT * FROM friend ORDER BY state;


firstname


| lastname


| city


| state


| age


Cindy


| Anderson


| Denver


| CO


| 23


Mike


| Nichols


| Tampa


| fl


| 20


Sam


| Jackson


| Allentown


| PA


| 22

(3 rows)


Figure 3.14: Use of order by

Скачать в pdf «PostgreSQL»