mysql案例如何查找北京和上海的学生

[复制链接]
查看1929 | 回复0 | 2020-9-30 16:53 | 显示全部楼层 |阅读模式
mysql数据库案例运行代码如下:
  1. -- 通过or实现
  2. mysql> select * from stu where stuaddress='北京' or stuaddress='上海';

  3. -- 通过in语句实现
  4. mysql> select * from stu where stuaddress in ('北京','上海');

  5. -- 查询不是北京和上海的学生
  6. mysql> select * from stu where stuaddress not in ('北京','上海');
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-16