Thursday, August 24, 2017

sqlite does what

>>> import sqlite3
>>> c = sqlite3.connect(':memory:')
<sqlite3.Connection object at 0x10d25c9d0>
>>> c.execute('select null and 1').fetchall()
[(None,)]
>>> c.execute('select null and 0').fetchall()
[(0,)]
>>> c.execute('select null or 1').fetchall()
[(1,)]
>>> c.execute('select null or 0').fetchall()
[(None,)]
SQlite's docs are fantastic: https://sqlite.org/nulls.html

1 comment:

  1. This is a fascinating Python blog. By the way, I'm currently browsing APA referencing style and came upon your site, which I appreciate you sharing. Python is a programming language used to construct websites and apps, automate tasks, and perform data analysis.

    ReplyDelete