0
点赞
收藏
分享

微信扫一扫

mysql中or和and的用法区别

in和or的条件可以俩接2个以上

in常用于where表达式中,其作用是查询某个范围内的数据。

PS: not in与in作用相反,用法和示例如下:

SELECT * from countries where id = 1 or id = 2 or id = 3 or id = 4;

在这里插入图片描述

select * from countries where id in (4,5,6,7);

在这里插入图片描述

举报

相关推荐

0 条评论