TEL:150-0382-3679
新闻资讯 News Center
建站知识 / 公司动态
and和or
 例子: 我想查询,username 为  张三,或者是李四的信息
   select *from userInfo where username='张三' or username='李四' (大多数的朋友,应该是这样写的吧!)
 但是,如果你的where 条件多了,很多的话,呵呵
      select *ffrom userInfo where userid=1 and username='张三' or username='李四'    and so on..(这样的话可能会有问题哦!)      最好这样写
     select *ffrom userInfo where userid=1 and (username='张三' or username='李四' )   and so on..(这样写的话,就没有问题,并且很美观)
一站式全网营销,您身边的网络营销顾问,为您一对一私人定制符合您实际需求的网络营销实施方案!
24小时咨询热线:
150-0382-3679