2列的逻辑运算(逻辑或)
答
tsql使用c#和其他c语言使用的相同位运算符。即| |为或,&为和,^为排他或。
可能是最适合你的问题的一个例子:
select (column1 | column2) from [YourTable];
如果你想测试所有选项,你可以试试这个块和测试各种可能性。
declare @col1 bit = 0 /** or 1 or null */
declare @col2 bit = 0 /** or 1 or null */
declare @col3 bit = null
set @col3 = (@col1 | @col2)
在这里阅读更多:http://msdn.microsoft.com/en-us/library/ms176122.aspx
更新下面简单的SELECT语句我的答案,也许更多的是你所期待的。 – RThomas 2011-05-31 17:44:55