MySQL NAND/NOR operations in Queries

前端 未结 1 730
借酒劲吻你
借酒劲吻你 2021-01-20 11:18

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 o

相关标签:
1条回答
  • 2021-01-20 11:33

    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

    0 讨论(0)
提交回复
热议问题