![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
1检索记录
文章平均质量分 67
Happy_beans
做一个快乐的开心豆
展开
-
1_SQLserver,oracle,mySQL---连接值
1.sqlserver 使用 + 运算符进行连接操作 select ename + 'work as a' + job as msg from emp where deptno=10 2.Oracle,DB2,PostgreSQL 使用双竖线作为连接运算符 select * ename || 'work as a' || job as msg翻译 2017-08-09 10:35:57 · 220 阅读 · 0 评论 -
1_SQL简单的查询语句
--:代表注释,在数据库选中他执行时,实际是不会执行的,可以用来写备注 --1:从表中检索所有行和列(查出表emp的所有信息) select * from emp -- select:是表示查询;‘*’表示所有的;emp 是表名 --2:从表中查询部分行(deptno 代表部门,意思是查询10号部门的所有信息) select * from emp where de翻译 2017-08-09 14:29:25 · 367 阅读 · 0 评论 -
1_SQL中符号+;连接符(SQLserver,DB2,oracle,PostreSQL,mySQL))
!= 不等于 SQL中 + 的意思 是一个外连接 如果这个连接成立,会选出这个对应的表中的数据,而不成立,仍然可以取得数据,不过和这个连接不成立的表的字段会为空。 base_user表 user_salary表 user id user name user id salary 0001翻译 2017-08-02 16:19:52 · 1621 阅读 · 0 评论 -
1_ case表达式 和限制行数,随机返回行数
--1.case表达式,用于如果...则.... --如果一个员工的工资小于2000则返回消息‘’underpaid’,如果大于4000则返回消息overpaid,,如果在这两者之间则返回‘ok’ select ename,sal, case when sal when sal >=4000 then ‘o翻译 2017-08-11 10:58:30 · 390 阅读 · 0 评论 -
1_,查空值和将空值转换为实际值,按模式搜索(匹配符%)
--1:查找comm为空的所有信息 ; select * from emp where comm is null --不为空:is not null --2:将空值转换为实际值; --只要comm非空,就返回 comm的值,否则返回0 select coalesce ( comm,0) from翻译 2017-08-14 09:49:44 · 475 阅读 · 0 评论