SQL62. 检索所有列
描述
cust_id | cust_name |
a1 | andy |
a2 | ben |
a3 | tony |
a4 | tom |
a5 | an |
a6 | lee |
a7 | hex |
cust_id | cust_name |
a1 | andy |
a2 | ben |
a3 | tony |
a4 | tom |
a5 | an |
a6 | lee |
a7 | hex |
示例1
输入:
DROP TABLE IF EXISTS `Customers`; CREATE TABLE IF NOT EXISTS `Customers`( cust_id VARCHAR(255) NOT NULL COMMENT '客户id', cust_name VARCHAR(255) NOT NULL COMMENT '客户姓名' ); INSERT `Customers` VALUES ('a1','andy'),('a2','ben'),('a3','tony'),('a4','tom'),('a5','an'),('a6','lee'),('a7','hex');
输出:
a1|andy a2|ben a3|tony a4|tom a5|an a6|lee a7|hex
Mysql 解法, 执行用时: 38ms, 内存消耗: 6548KB, 提交时间: 2022-03-05
select * from Customers #select cust_id from Customers
Mysql 解法, 执行用时: 38ms, 内存消耗: 6628KB, 提交时间: 2022-03-03
select cust_id, cust_name from Customers;
Mysql 解法, 执行用时: 39ms, 内存消耗: 6372KB, 提交时间: 2022-03-07
SELECT * FROM Customers
Mysql 解法, 执行用时: 39ms, 内存消耗: 6392KB, 提交时间: 2022-03-04
select cust_id, cust_name from Customers
Mysql 解法, 执行用时: 39ms, 内存消耗: 6432KB, 提交时间: 2022-03-05
select * from Customers /* select cust_id from Customers */