電子工業出版社 NG HOUSE DF 【例623】从样例数据库pubs的tits表中査询所有书籍,并按书名(tit列腓排序。 USE pub SELECt title, type RDER BY titl 运行结果: title But Is It User Friendly? popular comp Computer Phobic AND Non-Phobic Individuals: Behavior Variations psychology Cooking with Computers: Surreptitious Balance Sheets Emotional Security: A New Algorithm psychology Fifty Years in Buckingham Palace Kitchens trad cook Is Anger the Enemy psychology Life Without Fear psychology Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean trad cook Prolonged Data Deprivation: Four Case Studies psychology Secrets of silicon Val popular_ comp Silicon valley gastronomic Treat Straight Talk About Computers The Gourmet Microwave The Psychology of Computer Cooking UNDECIDED You Can Combat Computer Stress business (所影响的行数为18行) 查询结果显示表 titles中的所有书籍,并按书名的升序排序。缺省情况下, ORDER BY按升 序排序,若要按降序排序,须使用DESC关键字 【例624】从样例数据库pubs的tits表中査询所有书籍,并按书名(tit列)的降序排 序 USE pubs SELECt title, type ORDER BY title desc 运行结果: title
【例 6.23】从样例数据库 pubs 的 titles 表中查询所有书籍,并按书名(title 列)排序。 USE pubs SELECT title, type FROM titles ORDER BY title 运行结果: title type -------------------------------------------------------------------------------- But Is It User Friendly? popular_comp Computer Phobic AND Non-Phobic Individuals: Behavior Variations psychology Cooking with Computers: Surreptitious Balance Sheets business Emotional Security: A New Algorithm psychology Fifty Years in Buckingham Palace Kitchens trad_cook Is Anger the Enemy? psychology Life Without Fear psychology Net Etiquette popular_comp Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean trad_cook Prolonged Data Deprivation: Four Case Studies psychology Secrets of Silicon Valley popular_comp Silicon Valley Gastronomic Treats mod_cook Straight Talk About Computers business Sushi, Anyone? trad_cook The Busy Executive's Database Guide business The Gourmet Microwave mod_cook The Psychology of Computer Cooking UNDECIDED You Can Combat Computer Stress! business (所影响的行数为 18 行) 查询结果显示表 titles 中的所有书籍,并按书名的升序排序。缺省情况下,ORDER BY 按升 序排序,若要按降序排序,须使用 DESC 关键字。 【例 6.24】从样例数据库 pubs 的 titles 表中查询所有书籍,并按书名(title 列)的降序排 序。 USE pubs SELECT title, type FROM titles ORDER BY title DESC 运行结果: title type -----------------------------------------------------------------------
電子工業出版社 JEUISHING HOUSE DF ELECTRONCS INDSTR You Can Combat Computer Stress business The Psychology of Computer Cooking UNDECIDED The Gourmet Microwave mod cook The Busy Executive s Database Guide business Straight Talk About Computers Silicon Valley Gastronomic Treats Secrets of Silicon Valley Prolonged Data Deprivation: Four Case Studi Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean trad cook Net etiquette popular com Life Without Fear psychology Is Anger the Enemy? psychology Fifty Years in Buckingham Palace Kitchens Emotional Security: A New Algorithm psychology ooking with Computers: Surreptitious Balance Sheet Computer Phobic AND Non-Phobic Individuals: Behavior Variations psychology But Is It User Friendly? popular comp (所影响的行数为18行) 查询结果显示表 titles中的所有书籍,并按书名的降序排序。 【例625】从样例数据库pubs的tes表中査询所有书籍,先按书籍的类型(type列) 的升序排序,再按书名tte列)的降序排序 USE pubs SELECt title, type ROM titles ORDER BY type, title deSc 行结果 title You Can Combat Computer Stress The Busy Executive s Database Guide Straight Talk About Computers Cooking with Computers: Surreptitious Balance Sheets business The Gourmet Microwave Silicon valley gastronomic Treats Secrets of Silicon Valley popular- comp Net Etiquette But Is It User Friendly? popular com Prolonged Data Deprivation: Four Case Studies Life Without Fear psychology
You Can Combat Computer Stress! business The Psychology of Computer Cooking UNDECIDED The Gourmet Microwave mod_cook The Busy Executive's Database Guide business Sushi, Anyone? trad_cook Straight Talk About Computers business Silicon Valley Gastronomic Treats mod_cook Secrets of Silicon Valley popular_comp Prolonged Data Deprivation: Four Case Studies psychology Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean trad_cook Net Etiquette popular_comp Life Without Fear psychology Is Anger the Enemy? psychology Fifty Years in Buckingham Palace Kitchens trad_cook Emotional Security: A New Algorithm psychology Cooking with Computers: Surreptitious Balance Sheets business Computer Phobic AND Non-Phobic Individuals: Behavior Variations psychology But Is It User Friendly? popular_comp (所影响的行数为 18 行) 查询结果显示表 titles 中的所有书籍,并按书名的降序排序。 【例 6.25】从样例数据库 pubs 的 titles 表中查询所有书籍,先按书籍的类型(type 列) 的升序排序,再按书名(title 列)的降序排序。 USE pubs SELECT title, type FROM titles ORDER BY type, title DESC 运行结果: title type ------------------------------------------------------------------------------ You Can Combat Computer Stress! business The Busy Executive's Database Guide business Straight Talk About Computers business Cooking with Computers: Surreptitious Balance Sheets business The Gourmet Microwave mod_cook Silicon Valley Gastronomic Treats mod_cook Secrets of Silicon Valley popular_comp Net Etiquette popular_comp But Is It User Friendly? popular_comp Prolonged Data Deprivation: Four Case Studies psychology Life Without Fear psychology
電子工業出版社 JEUISHING HOUSE DF ELECTRONCS INDSTR Is Anger the Enemy? psychology Emotional Security: A New Algorithm psychology Computer Phobic AND Non-Phobic Individuals: Behavior Variations psychology Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean trad cook Fifty Years in Buckingham Palace Kitchens trad cook The Psychology of Computer Cooking UNDECIDED (所影响的行数为18行) 查询结果显示表ttes中的所有书籍,并先按书籍的类型(type列)的升序排序,然后再按 书名tte列)的降序排序
Is Anger the Enemy? psychology Emotional Security: A New Algorithm psychology Computer Phobic AND Non-Phobic Individuals: Behavior Variations psychology Sushi, Anyone? trad_cook Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean trad_cook Fifty Years in Buckingham Palace Kitchens trad_cook The Psychology of Computer Cooking UNDECIDED (所影响的行数为 18 行) 查询结果显示表 titles 中的所有书籍,并先按书籍的类型(type 列)的升序排序,然后再按 书名(title 列)的降序排序