mysql方法合集
| 方法 | 含义 | 备注 |
| 查询 | ||
| distinct 字段 | 对字段去重 | select distinct name, id from table |
| exists(select语句) |
表示是否存在这个里,存在返回true,反之返回false not exists:表示不在返回true,反之返回false |
select * from article where exists(select * from user where article.id = user.id) |
| FORCE INDEX | 对表增加索引,加快检索速度 | SELECT * FROM onlineSnapshot FORCE INDEX ( idx_syncStatus_c ) |
SELECT * FROM article WHERE EXISTS (SELECT * FROM user WHERE article.uid = user.uid)

浙公网安备 33010602011771号