描述
现有表Customers如下:
cust_id |
A |
B |
C |
【问题】
编写 SQL 语句,从 Customers 表中检索所有的cust_id
【示例答案】
返回cust_id列的内容
cust_id |
A |
B |
C |
示例1
输入:
DROP TABLE IF EXISTS `Customers`;
CREATE TABLE IF NOT EXISTS `Customers`(
cust_id VARCHAR(255) DEFAULT NULL
);
INSERT `Customers` VALUES ('A'),('B'),('C');
复制
输出:
A
B
C
答案
select * from Customers

该文介绍如何使用SQL语句从Customers表中检索所有的cust_id。示例提供了创建和填充Customers表的代码,以及执行SELECT*FROMCustomers命令来获取A,B,C等cust_id的示例。

被折叠的 条评论
为什么被折叠?



