SQL74. 纠错2
描述
vend_name | vend_country | vend_state |
apple | USA | CA |
vivo | CNA | shenzhen |
huawei | CNA | xian |
SELECT vend_name FROM Vendors ORDER BY vend_name WHERE vend_country = 'USA' AND vend_state = 'CA';【示例结果】
vend_name |
apple |
示例1
输入:
DROP TABLE IF EXISTS `Vendors`; CREATE TABLE IF NOT EXISTS `Vendors` ( `vend_name` VARCHAR(255) NOT NULL COMMENT 'vend名称', `vend_country` VARCHAR(255) NOT NULL COMMENT 'vend国家', `vend_state` VARCHAR(255) NOT NULL COMMENT 'vend州' ); INSERT INTO `Vendors` VALUES ('apple','USA','CA'), ('beef noodle king','USA','CA'), ('vivo','CNA','shenzhen'), ('huawei','CNA','xian');
输出:
apple beef noodle king
Mysql 解法, 执行用时: 39ms, 内存消耗: 6480KB, 提交时间: 2022-03-07
SELECT vend_name FROM Vendors WHERE vend_country = 'USA' AND vend_state = 'CA' ORDER BY vend_name;
Mysql 解法, 执行用时: 39ms, 内存消耗: 6512KB, 提交时间: 2022-03-04
SELECT vend_name FROM Vendors WHERE vend_country = 'USA' AND vend_state = 'CA' ORDER BY vend_name
Mysql 解法, 执行用时: 39ms, 内存消耗: 6644KB, 提交时间: 2022-03-04
select vend_name from Vendors where vend_country="USA" and vend_state="CA" order by vend_name;
Mysql 解法, 执行用时: 40ms, 内存消耗: 6392KB, 提交时间: 2022-06-04
SELECT vend_name FROM Vendors WHERE vend_country = 'USA' AND vend_state = 'CA' ORDER BY vend_name ;
Mysql 解法, 执行用时: 40ms, 内存消耗: 6432KB, 提交时间: 2022-06-04
SELECT vend_name FROM Vendors WHERE vend_country = 'USA' AND vend_state = 'CA' ORDER BY vend_name