假设您连接到名为Computers的数据库表,其中包含字段... [英] Assuming that you are connected to a database table called Computers with the fields...

查看:91
本文介绍了假设您连接到名为Computers的数据库表,其中包含字段...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您连接到名为Computers的数据库表,其中包含计算机,主机名Room_Num,CPU_Type,Num_CPU,Bit_Size,OS_Type,Memory和HDD_Size字段,请编写SQL查询字符串sqlStr,以便显示计算机,Room_Num和OS_Type将显示指示OS_Type为Fedora 10或Windows XP的记录。返回的记录应按OS_Type排序。

Assuming that you are connected to a database table called Computers with the fields Computer, Hostname Room_Num, CPU_Type, Num_CPUs, Bit_Size, OS_Type, Memory, and HDD_Size, write the SQL Query String sqlStr such that the fields Computer, Room_Num, and OS_Type will be displayed for the records that indicate an OS_Type of 'Fedora 10' or 'Windows XP'. The returned records should be sorted by OS_Type.

推荐答案

SELECT Computer, Room_Num, OS_Type FROM Computer WHERE OS_Type in ('Fedora 10', 'Windows XP') ORDER BY OS_Type ASC


这篇关于假设您连接到名为Computers的数据库表,其中包含字段...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆