|
SQL Order By Example One
Q: Who was in Blade Runner, Brazil, or The Matrix? Please show by film title.
Select Film_Title, Thespian_First_Name, Thespian_Last_Name
From Thespian_Film_Table
Where Film_Title in ("Blade Runner", "Brazil", "The Matrix")
Order by Film_Title;
Blade Runner, Harrison, Ford
Blade Runner, Rutger, Hauer
Blade Runner, Sean, Young
Blade Runner, Daryl, Hannah
Brazil, Jonathan, Pryce
Brazil, Robert, DeNiro
Brazil, Michael, Palin
The Matrix, Keanu, Reeves
SQL Order By Example Two
Q: Please show by thespian last name now.
Select Film_Title, Thespian_First_Name, Thespian_Last_Name
From Thespian_Film_Table
Where Film_Title in ("Blade Runner", "Brazil", "The Matrix")
Order by Thespian_Last_Name;
Brazil, Robert, DeNiro
Blade Runner, Harrison, Ford
Blade Runner, Daryl, Hannah
Blade Runner, Rutger, Hauer
Brazil, Michael, Palin
Brazil, Jonathan, Pryce
The Matrix, Keanu, Reeves
Blade Runner, Sean, Young
SQL Order By Example Three
Q: Now show the same thing in reverse order.
Select Film_Title, Thespian_First_Name, Thespian_Last_Name
From Thespian_Film_Table
Where Film_Title in ("Blade Runner", "Brazil", "The Matrix")
Order by Thespian_Last_Name Descend;
Blade Runner, Sean, Young
The Matrix, Keanu, Reeves
Brazil, Jonathan, Pryce
Brazil, Michael, Palin
Blade Runner, Rutger, Hauer
Blade Runner, Daryl, Hannah
Blade Runner, Harrison, Ford
Brazil, Robert, DeNiro
Note: The default order is ascend, you must specify descend when you want descend.
Also Note: For some DBMSs you must specify desc instead of descend when you want descend.
Add by Pancho
You can edit it here
|
|
Adding comments is available only for registered users.
|
From the Heart: How Cells Divide to Form Different but Related Muscle Groups
Using the model organism Ciona intestinalis, commonly known as the sea squirt, researchers at the University of California, Berkeley, have uncovered the origins of the second heart field in vertebrates. Sea squirts are bag-like gelatinous creatures whose full genome has been sequenced--one that shares 80 percent of its genes with humans. Though its body is clearly more primitive than creatures with backbones and spinal columns, the sea squirt nevertheless offers a valuable ...
More at http://www.nsf.gov/news/news_summ.jsp?cntn_id=117378&WT.mc_id=USNSF_51&WT.mc_ev=click
This is an NSF News item.
|
|
PycckaR BepcuR
Articles

Library

Downloads

|