mysql 常用sql
mysql 常用sql
- 更新执行 表 test01 的
wifi_open_id
='xxxx' 这个条数数据
UPDATE `test01 ` SET `nickname`='xxxx' WHERE (`appid `='xxxx');
- 查询多张表的多个字段
select a.phone, b.appid from test01 a, test02 b WHERE (a.appid ='xxx')
- 根据name 降序查询
SELECT name FROM test01 ORDER BY name DESC;
- 根据name 降序查询
SELECT name FROM test01 ORDER BY name AES;
- 根据name 降序查询并且去重
SELECT DISTINCT name FROM test01 ORDER BY name AES;
- 根据name 统计次数
SELECT name COUNT(*) FROM test01 ORDER BY name AES;
欢迎各位大虾指正