4

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.

DonOfDen
  • 3,968
  • 11
  • 62
  • 112

1 Answers1

9

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

Ian Kenney
  • 6,376
  • 1
  • 25
  • 44