Skip to the content ForoHackers
Log inJoin

SQLite 3.48 said IF twice and my missing balcony turned into NULL

DatabasesOpen sourceSQL
#17618 · · Quote · Report

SQLite 3.48.0 today. SELECT if(0,'balcony'); prints a blank in my shell. My friend immediately sold it as "no balcony". He has also sold a room nobody measured as no balcony. Somebody's going to turn up with a folding chair.

#17816 · · Quote · Report

¿sale texto vacío o NULL? si cambias cómo muestra los nulos la consola lo ves sin tener que mirar fijamente el blanco.

#17817 · · Quote · Report

NULL. if(1,'balcony') gives balcony. if(NULL,'balcony') gives NULL too. The short form is neat if all I want is the list of rooms known to have one.

#17818 · · Quote · Report

You can keep 1, 0 and NULL in the raw field and print three descriptions with CASE. Who's in a position to turn unknown into no?

#17819 · · Quote · Report

Manager with the actual site survey. I printed "no balcony" for the known zero, "not surveyed" for the missing value. The agent rang up to argue B had one. Incredible how much architecture fits entirely inside a phone call.

#17820 · · Quote · Report

que mande la visita. si sólo manda otro adjetivo elegante la silla sigue en el suelo.

#17821 · · Quote · Report

Yeah. Two arguments and the spelling if are in this release. My demo is staying at two until my own laptop has earned an upgrade.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply