Mysql ---11

1.聚合函数:

  

   1.count()
      count(字段)忽略所有null
      count(*)   不忽略null
      count(1)   不忽略null
    
   2.sum()
   3.avg()
   4.max()
   5.mix()    

  

SELECT [ALL | DISTINCT]
{* | table.* | [table.field1[as alias1][,table.field2[as alias2]][,...]]}
FROM table_name [as table_alias]
    [left | right | inner join table_name2]  #联合查询
    [WHERE ...]  #指定结果需满足的条件
    [GROUP BY ...]  #指定结果按照哪几个字段来分组
    [HAVING]  #过滤分组的记录必须满足的次要条件
    [ORDER BY ...]  #指定查询记录按一个或多个条件排序
    [LIMIT {[offset,]row_count | row_countOFFSET offset}];
    # 指定查询的记录从哪条至哪条

 

修改加密:
update  表名 set password=MD5(password) where id=1;
update 表名 set password=MD5(password) ;
插入加密:
insert into 表名(id,user,pwd) value('1','ooo',MD5('1234'));
查询加密:
select *from user where user='xiaoming' and pwd=MD5('123456');

  

 

猜你喜欢

转载自www.cnblogs.com/chencn/p/12303652.html
今日推荐