首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

一个sql语句的拆解有关问题,与或运算的

2012-02-26 
一个sql语句的拆解问题,与或运算的就是我要组合查询所有要拼接sql语句现在sqlupdate table set v1 where

一个sql语句的拆解问题,与或运算的
就是我要组合查询所有要拼接sql语句
现在
sql=update table set v=1 where rundate='xxxxxx' and a!='' and (a=1 or a=2 or a=5);

组合查询时要用and连接才能使同一层次。就是怎么把括号去掉 a的值之间用and连接,这样才能是同一个层次条件,以前记得离散数学学过忘了。

请提示一下。

[解决办法]
不知所云回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 
回复内容太短了! 

[解决办法]

SQL code
--and a!='' 和 and (a = 1 or a = 2 or a = 5)不会同时成立update table set v=1 where rundate='xxxxxx' and a in(1, 2, 5);
[解决办法]
楼上做的比较简单 

通俗 and 去括号应该这样

update table set v=1 where rundate='xxxxxx' and a=1 or update table set v=1 where rundate='xxxxxx' and a=2 or update table set v=1 where rundate='xxxxxx' and a=5
[解决办法]
探讨
SQL code--and a!='' 和 and (a = 1 or a = 2 or a = 5)不会同时成立updatetableset v=1where rundate='xxxxxx'and ain(1,2,5);

热点排行