数据库SQL有关的其他

之前的记录
1DISTINCT  ------去除重复记录

2、解决sal+comm(基本工资+奖金)中comm为null的情况

  当为mysql的时候 IFNULL(comm,0---------->sal+IFNULL(comm,0);

  当为oracle的时候NVL(comm,0---------->sal+NVL(comm,0);另外oracle中还有NVL2(expr1, expr2, expr3),当expr1不为null的时候使用的是expr2,为null使用expr3

3、对于符合SQL92/99】标准的四大分类标准的DDL

  alter table employee MODIFY  image  varchar(60); ---------->对于mysql/oracle 进行数据表对应的字段的修改

4、对于oracle的pl/sql以及对应的光标问题

  cursor  cemp[option exp1  type...]  is select *  from emp [option where  xx=xx];

  xxxx  exception ;---------->定义异常参数

  raise  xxxx;---------->--抛自定义异常

  procedure ----------> 用于创建存储过程时的关键词

  trigger  ---------->用于创建触发器的关键词
View Code

1、对于mysql工具远程连接客户端的操作出现如下错误解决方法

方法一、通过查询要连接的数据库的mysql库,然后查询user表,查询对应的账号

>select * from mysql.user where User='root';

>update mysql.user set Host='ip' where User='root';

重新连接

$mysql -hip -Pport -u -p

>mysql -h192.168.137.1 -P3306 -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host 'DESKTOP-DKSCN61' is not allowed to connect to this MySQL server

 

posted @ 2017-02-10 22:32  ffzzblog  阅读(52)  评论(0)    收藏  举报