Nebo možná živá i mrtvá zároveň…

  1. mysql> CREATE TABLE cats (
  2. mysql>   owner_name VARCHAR(50),
  3. mysql>   is_alive ENUM('alive', 'dead') NOT NULL);
  4. Query OK, 0 rows affected (0.07 sec)
  5.  
  6. mysql> INSERT INTO cats VALUES ('Erwin Schrödinger', '');
  7. Query OK, 1 row affected, 1 warning (0.00 sec)
  8.  
  9. mysql> SELECT * FROM cats WHERE is_alive = 'alive';
  10. Empty SET (0.00 sec)
  11.  
  12. mysql> SELECT * FROM cats WHERE is_alive = 'dead';
  13. Empty SET (0.00 sec)
  14.  
  15. mysql> SELECT * FROM cats WHERE is_alive = '';          
  16. +===================+==========+
  17. | owner_name        | is_alive |
  18. +===================+==========+
  19. | Erwin Schrödinger |          |
  20. +===================+==========+
  21. 1 row IN SET (0.00 sec)

« »