PostgreSQL

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


test-> ORDER BY firstname, lastname;


firstname


| lastname —+——————-


| state —+——


Dean


| Yeager


| MA


Ned


| Millstone


| MD


Sandy


| Weber


| MA


Victor


| Tabor


| PA


(4 rows)

test=> SELECT fl.firstname, fl.lastname, fl.state test-> FROM friend fl test-> WHERE fl.state <> (


test(>


SELECT


f2.state


test(>


FROM


friend f2


test(>


WHERE


f2.firstname = ‘Dick’ AND


test(>


f2.lastname= ‘Gleason’


test(>


)

test-> ORDER BY firstname, lastname;


firstname |    lastname    | state


——————+———————-+——


Dean


| Yeager


| MA


Ned


| Millstone


| MD


Sandy


| Weber


| MA


Victor


| Tabor


| PA


(4 rows)

Figure 8.7: Friends not in Dick Gleason’s state


name


customer, salesorder


customer.customer_id = salesorder.customer_1d AND


salesorder.order_1d = 14673;


name


Fleer Gearworks, Inc. (1 row)


Л


II


+->


</>


CD


+->


SELECT


name


Л


+->


</)


CD


+->


FROM


customer


Л


+->


</)


CD


+->


WHERE


customer.customer id


=(


test(>


SELECT salesorder.customer id


test(>


FROM salesorder

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