電子工業出版社 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 -----------------------------------------------------------------------