Reputation: 4098
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.
Upvotes: 4
Views: 14042
Reputation: 6436
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
Upvotes: 9