1、语法 SELECT 要查询的东西 FROM 表名 ; 类似于Java中:System.out.println(要打印的东西); 2、特点 ①通过select查询完的结果,是一个虚拟的表格,不是真实存在。 ② 要查询的东西可以是常量值、可以是表达式、可以是字段、可以是函数。 3、查询表中的单个字段 ...
分类:
数据库 时间:
2018-05-20 18:08:13
阅读次数:
193
There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees ...
分类:
其他好文 时间:
2018-05-19 20:02:44
阅读次数:
170
1、UNION用的比较多 语法如下: select employee_id,job_id from employees union select employee_id,job_id from job_history 2、union all是直接连接,取到得是所有值,记录可能有重复。 语法如下: s ...
分类:
其他好文 时间:
2018-05-19 15:49:02
阅读次数:
145
A. Fafa and his Company Fafa owns a company that works on huge projects. There are n employees in Fafa's company. Whenever the company has a new proje ...
分类:
其他好文 时间:
2018-05-01 14:06:42
阅读次数:
215
SQL LINQ Lambda SELECT *FROM HumanResources.Employee from e in Employees select e Employees .Select (e => e) SELECT e.LoginID, e.JobTitle FROM HumanRe ...
分类:
数据库 时间:
2018-04-29 18:36:05
阅读次数:
185
正则表达式REGEXP_LIKE执行正则表达式匹配SELECT FIRST_NAMEFROM EMPLOYEESWHERE REGEXP_LIKE(FIRST_NAME,'^al(an|yss)a$','i');--al之后是an或yssSELECT FIRST_NAMEFROM EMPLOYEES... ...
分类:
数据库 时间:
2018-04-29 15:22:25
阅读次数:
209
创建一个名称为EMPLOYEES_VU的视图,它基于EMPLOYEES表中的雇员号、雇员名和部门号。将雇员名的列标题改为EMPLOYEE。CREATE VIEW EMPLOYEES_VU AS SELECT EMPLOYEE_ID EMPLOYEE,FIRST_NAME,LAST_NAME,DEPA... ...
分类:
数据库 时间:
2018-04-27 15:49:37
阅读次数:
383
防止SQL注入,我们需要注意以下几个要点: 1.永远不要信任用户的输入。对用户的输入进行校验,可以通过正则表达式,或限制长度;对单引号和 双"-"进行转换等。 2.永远不要使用动态拼装sql,可以使用参数化的sql或者直接使用存储过程进行数据查询存取。 3.永远不要使用管理员权限的数据库连接,为每个 ...
分类:
数据库 时间:
2018-04-09 13:24:07
阅读次数:
217
常见函数: mysql> select sum(salary) from employees; + + | sum(salary) | + + | 691400.00 | + + 1 row in set (0.00 sec) mysql> select avg(salary) from emplo ...
分类:
数据库 时间:
2018-04-08 16:04:49
阅读次数:
204