查询中的MySQL NAND / NOR操作 [英] MySQL NAND/NOR operations in Queries

查看:240
本文介绍了查询中的MySQL NAND / NOR操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人能帮我解释如何为NAND和NOR写一个查询吗?



我很困惑?有什么好的例子帮助理解查询中的NAND和NOR操作吗?



我在两个SQL查询之间进行AND和OR操作。但是当我搜索

解决方案

你可以组合Not + And / Not + / p>

例如

 创建表测试(v1位,v2位) ; 
插入到测试值(false,false),(false,true),(true,true),(true,false);

选择v1,v2,而不是(v1和v2)nand,而不是(v1或v2)或
从测试

http:// sqlfiddle。 com /#!/ 2 / 0828b / 3


Can any one help me in explaining how to write a query for NAND and NOR?

I am getting confused? Is there any good example which help to understand the NAND and NOR operation in query?

I worked in AND and OR operation between two SQL Queries.. But when I am searching some thing related to NAND/NOR I cant find any tutorial.

解决方案

You can just combine Not + And / Not + Or

for example

create table test( v1 bit, v2 bit ); 
insert into test values ( false, false), (false,true), (true,true), (true,false);

select v1, v2, not (v1 and v2) "nand", not (v1 or v2) "nor"
from test

http://sqlfiddle.com/#!2/0828b/3

这篇关于查询中的MySQL NAND / NOR操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆