SQL58 获取employees中的行数据

本文最后更新于:2022年4月9日 中午


题目描述

存在如下的视图:

1
2
3
4
5
6
7
8
9
10
create view emp_v as select * from employees where emp_no >10005;

CREATE TABLE `employees` (
`emp_no` int(11) NOT NULL,
`birth_date` date NOT NULL,
`first_name` varchar(14) NOT NULL,
`last_name` varchar(16) NOT NULL,
`gender` char(1) NOT NULL,
`hire_date` date NOT NULL,
PRIMARY KEY (`emp_no`));

获取employees中的行数据,且这些行也存在于emp_v中。注意不能使用intersect关键字。

(你能不用select * from employees where emp_no >10005 这条语句完成吗,挑战一下自己对视图的理解)

输入描述

输出描述

题解

1
select * from emp_v;

备注:

  1. 同题 [SQL47](https://ronnyz.gitee.io/2020/08/14/SQL47 如何获取emp_v和employees有相同的数据/) 。。。