mysql 常用sql

mysql 常用sql

  1. 更新执行 表 test01 的 wifi_open_id='xxxx' 这个条数数据
  UPDATE `test01 ` SET  `nickname`='xxxx' WHERE (`appid `='xxxx');
  1. 查询多张表的多个字段
  select  a.phone, b.appid from test01 a,  test02 b WHERE (a.appid ='xxx')
  1. 根据name 降序查询
  SELECT  name  FROM test01 ORDER BY name DESC;
  1. 根据name 降序查询
  SELECT  name  FROM test01 ORDER BY name AES;
  1. 根据name 降序查询并且去重
  SELECT DISTINCT name  FROM test01 ORDER BY name AES;
  1. 根据name 统计次数
  SELECT  name COUNT(*) FROM test01 ORDER BY name AES;
posted @ 2020-07-22 15:48  老年游侠  阅读(96)  评论(0编辑  收藏  举报